riscv: export boot_cpu_hartid
Subsystems (2)
PATCH 1/1 riscv: export boot_cpu_hartid
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.
--- arch/riscv/kernel/setup.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kernel/setup.c +1 -0
@@ -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
Signature · 1 line
2.49.0
Quoted 6 lines · Klara Modin
The mailbox controller driver for the Microchip Inter-processor Communication can be built as a module. It uses
cpuid_to_hartid_mapand commit4783ce32b080("riscv: export__cpuid_to_hartid_map") enables that to work for SMP. However,cpuid_to_hartid_mapusesboot_cpu_hartidon non-SMP kernels and this driver can be useful in such configurations[1].
Quoted 6 lines
Export
boot_cpu_hartidso the driver can be built as a module on non-SMP kernels as well.Fixes e4b1d67e7141 ("mailbox: add Microchip IPC support")
I'm not sure that this fixes tag is really right, but I have no better suggestions
Quoted 20 lines
Signed-off-by Klara Modin <[email protected]>--- arch/riscv/kernel/setup.c | 1 + 1 file changed, 1 insertion(+)arch/riscv/kernel/setup.c +1
-0@@ -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 Signature · 1 line
2.49.0
Palmer Dabbelt
maintainerQuoted 10 lines · Conor Dooley
Quoted 9 lines · Klara Modin
The mailbox controller driver for the Microchip Inter-processor Communication can be built as a module. It uses
cpuid_to_hartid_mapand commit4783ce32b080("riscv: export__cpuid_to_hartid_map") enables that to work for SMP. However,cpuid_to_hartid_mapusesboot_cpu_hartidon non-SMP kernels and this driver can be useful in such configurations[1].Export
boot_cpu_hartidso the driver can be built as a module on non-SMP kernels as well.
Quoted 6 lines
Quoted 3 lines
Fixes e4b1d67e7141 ("mailbox: add Microchip IPC support")I'm not sure that this fixes tag is really right, but I have no better suggestions
Seems OK to me, the driver is what causes the symbol to need the definition, so that patch is the first place we'd need this (unless some other drivers want it, which wouldn't be surprising).
I'm throwing it at the tester, it should show up on fixes soon.
Thanks!
Quoted 22 lines
Acked-by Conor Dooley <[email protected]>Quoted 20 lines
Signed-off-by Klara Modin <[email protected]>--- arch/riscv/kernel/setup.c | 1 + 1 file changed, 1 insertion(+)arch/riscv/kernel/setup.c +1
-0@@ -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 Signature · 1 line
2.49.0
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:
Quoted 10 lines · On Tue, 17 Jun 2025 14:58:47 +0200 you wrote:
The mailbox controller driver for the Microchip Inter-processor Communication can be built as a module. It uses
cpuid_to_hartid_mapand commit4783ce32b080("riscv: export__cpuid_to_hartid_map") enables that to work for SMP. However,cpuid_to_hartid_mapusesboot_cpu_hartidon non-SMP kernels and this driver can be useful in such configurations[1].Export
boot_cpu_hartidso the driver can be built as a module on non-SMP kernels as well.[...]
Here is the summary with links:
- riscv: export boot_cpu_hartid
https://git.kernel.org/riscv/c/c5136add3f9b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html