summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2018-09-11 11:30:18 -0700
committerPalmer Dabbelt <palmer@sifive.com>2018-10-02 12:50:01 -0700
commitef1f2258748b675422ca0107e5bfb9ceeac675de (patch)
tree64ea5c324fc2b1c3188de3029a0b47a0e0709e16 /arch
parent17b57b1883c1285f3d0dc2266e8f79286a7bef38 (diff)
RISCV: Fix end PFN for low memory
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/kernel/setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index aee603123030..b2d26d9d8489 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -186,7 +186,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();