]> git.hungrycats.org Git - linux/commitdiff
RISCV: Fix end PFN for low memory
authorAtish Patra <atish.patra@wdc.com>
Tue, 11 Sep 2018 18:30:18 +0000 (11:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:51:47 +0000 (14:51 +0100)
[ Upstream commit ef1f2258748b675422ca0107e5bfb9ceeac675de ]

Use memblock_end_of_DRAM which provides correct last low memory
PFN. Without that, DMA32 region becomes empty resulting in zero
pages being allocated for DMA32.

This patch is based on earlier patch from palmer which never
merged into 4.19. I just edited the commit text to make more
sense.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/setup.c

index 0efa5b29d0a315f4236d4bf3475a2430a5265872..dcff272aee061e919c484d32ec5c45773d35e0d5 100644 (file)
@@ -165,7 +165,7 @@ static void __init setup_bootmem(void)
        BUG_ON(mem_size == 0);
 
        set_max_mapnr(PFN_DOWN(mem_size));
-       max_low_pfn = pfn_base + PFN_DOWN(mem_size);
+       max_low_pfn = memblock_end_of_DRAM();
 
 #ifdef CONFIG_BLK_DEV_INITRD
        setup_initrd();