From: Guo Ren <guoren@linux.alibaba.com>
Date: Wed, 20 Jan 2021 09:21:57 +0000 (+0800)
Subject: csky: Fixup pfn_valid error with wrong max_mapnr
X-Git-Tag: howlett/maple/20220722_2~3626^2~2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c47e1a1cb6d473172d4d9c24056960bd542dc56c;p=users%2Fjedix%2Flinux-maple.git

csky: Fixup pfn_valid error with wrong max_mapnr

The max_mapnr is the number of PFNs, not absolute PFN offset.
Using set_max_mapnr API instead of setting the value directly.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
---

diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
index bc05a3be9d57..81e4e5e78f38 100644
--- a/arch/csky/mm/init.c
+++ b/arch/csky/mm/init.c
@@ -86,9 +86,9 @@ void __init mem_init(void)
 #ifdef CONFIG_HIGHMEM
 	unsigned long tmp;
 
-	max_mapnr = highend_pfn;
+	set_max_mapnr(highend_pfn - ARCH_PFN_OFFSET);
 #else
-	max_mapnr = max_low_pfn;
+	set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
 #endif
 	high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);