Browse Source

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>
Atish Patra 7 years ago
parent
commit
ef1f225874
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/riscv/kernel/setup.c

+ 1 - 1
arch/riscv/kernel/setup.c

@@ -186,7 +186,7 @@ static void __init setup_bootmem(void)
 	BUG_ON(mem_size == 0);
 	BUG_ON(mem_size == 0);
 
 
 	set_max_mapnr(PFN_DOWN(mem_size));
 	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
 #ifdef CONFIG_BLK_DEV_INITRD
 	setup_initrd();
 	setup_initrd();