]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
riscv: export boot_cpu_hartid
authorKlara Modin <klarasmodin@gmail.com>
Tue, 17 Jun 2025 12:58:47 +0000 (14:58 +0200)
committerPalmer Dabbelt <palmer@dabbelt.com>
Mon, 23 Jun 2025 23:30:05 +0000 (16:30 -0700)
The mailbox controller driver for the Microchip Inter-processor
Communication can be built as a module. It uses cpuid_to_hartid_map and
commit 4783ce32b080 ("riscv: export __cpuid_to_hartid_map") enables that
to work for SMP. However, cpuid_to_hartid_map uses boot_cpu_hartid on
non-SMP kernels and this driver can be useful in such configurations[1].

Export boot_cpu_hartid so the driver can be built as a module on non-SMP
kernels as well.

Link: https://lore.kernel.org/lkml/20250617-confess-reimburse-876101e099cb@spud/
Cc: stable@vger.kernel.org
Fixes: e4b1d67e7141 ("mailbox: add Microchip IPC support")
Signed-off-by: Klara Modin <klarasmodin@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250617125847.23829-1-klarasmodin@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
arch/riscv/kernel/setup.c

index f7c9a1caa83e62a7999d82cfa24a9345c3046351..14888e5ea19ab175527e5e17bf2b970cb16d8858 100644 (file)
@@ -50,6 +50,7 @@ atomic_t hart_lottery __section(".sdata")
 #endif
 ;
 unsigned long boot_cpu_hartid;
+EXPORT_SYMBOL_GPL(boot_cpu_hartid);
 
 /*
  * Place kernel memory regions on the resource tree so that