From: Jisheng Zhang Date: Thu, 2 Dec 2021 15:36:41 +0000 (+0800) Subject: riscv: mm: fix wrong phys_ram_base value for RV64 X-Git-Tag: v6.6.17~8362^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0fd4b1bf995172b9efcee23600d4f69571c321c;p=platform%2Fkernel%2Flinux-rpi.git riscv: mm: fix wrong phys_ram_base value for RV64 Currently, if 64BIT and !XIP_KERNEL, the phys_ram_base is always 0, no matter the real start of dram reported by memblock is. Fixes: 6d7f91d914bc ("riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion") Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 5f4f030..0624c68 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -187,10 +187,10 @@ static void __init setup_bootmem(void) phys_ram_end = memblock_end_of_DRAM(); -#ifndef CONFIG_64BIT #ifndef CONFIG_XIP_KERNEL phys_ram_base = memblock_start_of_DRAM(); #endif +#ifndef CONFIG_64BIT /* * memblock allocator is not aware of the fact that last 4K bytes of * the addressable memory can not be mapped because of IS_ERR_VALUE