From e7ce1ec88e8a76fe05f23b8b5a852721d912eb8f Mon Sep 17 00:00:00 2001 From: Alexandre Ghiti Date: Tue, 11 Mar 2025 08:51:19 +0900 Subject: [PATCH] riscv: Fix wrong usage of __pa() on a fixmap address BugLink: https://bugs.launchpad.net/bugs/2101915 commit c796e187201242992d6d292bfeff41aadfdf3f29 upstream. riscv uses fixmap addresses to map the dtb so we can't use __pa() which is reserved for linear mapping addresses. Fixes: b2473a359763 ("of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify") Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20241209074508.53037-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman (cherry picked from commit aa9b1d0d6a5b45dc16191e1b1c6851fe52e5a1db linux-6.6.y) [koichiroden: follow-up fix from v6.6.67] Signed-off-by: Koichiro Den Signed-off-by: Stefan Bader --- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 38404e9e9dfb..e259f3012b44 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -227,7 +227,7 @@ static void __init init_resources(void) static void __init parse_dtb(void) { /* Early scan of device tree from init memory */ - if (early_init_dt_scan(dtb_early_va, __pa(dtb_early_va))) { + if (early_init_dt_scan(dtb_early_va, dtb_early_pa)) { const char *name = of_flat_dt_get_machine_name(); if (name) {