aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sverdlin <alexander.sverdlin@gmail.com>2015-09-03 02:36:35 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-09-22 11:25:33 -0400
commit88d3426942d748b90b051b7ef2d5d765f5f3054c (patch)
tree9b081f98f9caf5bb47bd3b0df0975993f7d32ea1
parentfc2ca674470bbfe11d72a20a3f19fd3dc43bfca0 (diff)
MIPS: bootmem: Fix mapstart calculation for contiguous maps
Commit a6335fa1 fixed the case with gap between initrd and next usable PFN zone, but broken the case when initrd is combined with usable memory into one region (in add_memory_region()). Restore the fixup initially brought in by f9a7febd. ---- error message ---- Unpacking initramfs... Initramfs unpacking failed: junk in compressed archive BUG: Bad page state in process swapper pfn:00261 page:81004c20 count:0 mapcount:-127 mapping: (null) index:0x2 flags: 0x0() page dumped because: nonzero mapcount CPU: 0 PID: 1 Comm: swapper Not tainted 4.2.0+ #1782 ----------------------- Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Reported-by: Tony Wu <tung7970@gmail.com> Tested-by: Tony Wu <tung7970@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: Joe Perches <joe@perches.com> Cc: Steven J. Hill <Steven.Hill@imgtec.com> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: stable@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11086/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/kernel/setup.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 35b8316002f8..479515109e5b 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -338,7 +338,7 @@ static void __init bootmem_init(void)
338 if (end <= reserved_end) 338 if (end <= reserved_end)
339 continue; 339 continue;
340#ifdef CONFIG_BLK_DEV_INITRD 340#ifdef CONFIG_BLK_DEV_INITRD
341 /* mapstart should be after initrd_end */ 341 /* Skip zones before initrd and initrd itself */
342 if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end))) 342 if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end)))
343 continue; 343 continue;
344#endif 344#endif
@@ -371,6 +371,14 @@ static void __init bootmem_init(void)
371 max_low_pfn = PFN_DOWN(HIGHMEM_START); 371 max_low_pfn = PFN_DOWN(HIGHMEM_START);
372 } 372 }
373 373
374#ifdef CONFIG_BLK_DEV_INITRD
375 /*
376 * mapstart should be after initrd_end
377 */
378 if (initrd_end)
379 mapstart = max(mapstart, (unsigned long)PFN_UP(__pa(initrd_end)));
380#endif
381
374 /* 382 /*
375 * Initialize the boot-time allocator with low memory only. 383 * Initialize the boot-time allocator with low memory only.
376 */ 384 */