From: Mike Rapoport <rppt@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Greg Ungerer <gerg@linux-m68k.org>,
Guenter Roeck <linux@roeck-us.net>,
"Mike Rapoport (IBM)" <rppt@kernel.org>,
Rich Felker <dalias@libc.org>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
linux-mm@kvack.org, linux-sh@vger.kernel.org
Subject: [PATCH 2/2] sh: initialize max_mapnr
Date: Tue, 14 Feb 2023 16:07:29 +0200 [thread overview]
Message-ID: <20230214140729.1649961-3-rppt@kernel.org> (raw)
In-Reply-To: <20230214140729.1649961-1-rppt@kernel.org>
From: "Mike Rapoport (IBM)" <rppt@kernel.org>
sh never initializes max_mapnr which is used by the generic
implementation of pfn_valid().
Initialize max_mapnr with set_max_mapnr() in sh::paging_init().
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: e5080a967785 ("mm, arch: add generic implementation of pfn_valid() for FLATMEM")
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
---
arch/sh/mm/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 506784702430..bf1b54055316 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -301,6 +301,7 @@ void __init paging_init(void)
*/
max_low_pfn = max_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT;
min_low_pfn = __MEMORY_START >> PAGE_SHIFT;
+ set_max_mapnr(max_low_pfn - min_low_pfn);
nodes_clear(node_online_map);
--
2.35.1
next prev parent reply other threads:[~2023-02-14 14:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 14:07 [PATCH 0/2] fixups for generic implementation of pfn_valid() Mike Rapoport
2023-02-14 14:07 ` [PATCH 1/2] m68k/nommu: add missing definition of ARCH_PFN_OFFSET Mike Rapoport
2023-02-15 12:16 ` Greg Ungerer
2023-02-16 12:55 ` David Hildenbrand
2023-02-14 14:07 ` Mike Rapoport [this message]
2023-02-14 14:41 ` [PATCH 2/2] sh: initialize max_mapnr John Paul Adrian Glaubitz
2023-02-16 12:56 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230214140729.1649961-3-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dalias@libc.org \
--cc=geert@linux-m68k.org \
--cc=gerg@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox