Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: export boot_cpu_hartid
@ 2025-06-17 12:58 Klara Modin
  2025-06-19 10:25 ` Conor Dooley
  2025-06-24  0:50 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 4+ messages in thread
From: Klara Modin @ 2025-06-17 12:58 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, conor.dooley,
	valentina.fernandezalanis
  Cc: linux-riscv, linux-kernel, Klara Modin, stable

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/ [1]
Cc: stable@vger.kernel.org
Fixes: e4b1d67e7141 ("mailbox: add Microchip IPC support")
Signed-off-by: Klara Modin <klarasmodin@gmail.com>
---
 arch/riscv/kernel/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index f7c9a1caa83e..14888e5ea19a 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -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
-- 
2.49.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: export boot_cpu_hartid
  2025-06-17 12:58 [PATCH] riscv: export boot_cpu_hartid Klara Modin
@ 2025-06-19 10:25 ` Conor Dooley
  2025-06-23 23:35   ` Palmer Dabbelt
  2025-06-24  0:50 ` patchwork-bot+linux-riscv
  1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2025-06-19 10:25 UTC (permalink / raw)
  To: Klara Modin
  Cc: paul.walmsley, palmer, aou, alex, valentina.fernandezalanis,
	linux-riscv, linux-kernel, stable


[-- Attachment #1.1: Type: text/plain, Size: 1426 bytes --]

On Tue, Jun 17, 2025 at 02:58:47PM +0200, Klara Modin wrote:
> 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/ [1]
> Cc: stable@vger.kernel.org
> Fixes: e4b1d67e7141 ("mailbox: add Microchip IPC support")

I'm not sure that this fixes tag is really right, but I have no better
suggestions
Acked-by: Conor Dooley <conor.dooley@microchip.com>

> Signed-off-by: Klara Modin <klarasmodin@gmail.com>
> ---
>  arch/riscv/kernel/setup.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index f7c9a1caa83e..14888e5ea19a 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -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
> -- 
> 2.49.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: export boot_cpu_hartid
  2025-06-19 10:25 ` Conor Dooley
@ 2025-06-23 23:35   ` Palmer Dabbelt
  0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2025-06-23 23:35 UTC (permalink / raw)
  To: Conor Dooley
  Cc: klarasmodin, Paul Walmsley, aou, Alexandre Ghiti,
	valentina.fernandezalanis, linux-riscv, linux-kernel, stable

On Thu, 19 Jun 2025 03:25:16 PDT (-0700), Conor Dooley wrote:
> On Tue, Jun 17, 2025 at 02:58:47PM +0200, Klara Modin wrote:
>> 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/ [1]
>> Cc: stable@vger.kernel.org
>> 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!

> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>
>> Signed-off-by: Klara Modin <klarasmodin@gmail.com>
>> ---
>>  arch/riscv/kernel/setup.c | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
>> index f7c9a1caa83e..14888e5ea19a 100644
>> --- a/arch/riscv/kernel/setup.c
>> +++ b/arch/riscv/kernel/setup.c
>> @@ -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
>> -- 
>> 2.49.0
>> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: export boot_cpu_hartid
  2025-06-17 12:58 [PATCH] riscv: export boot_cpu_hartid Klara Modin
  2025-06-19 10:25 ` Conor Dooley
@ 2025-06-24  0:50 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-06-24  0:50 UTC (permalink / raw)
  To: Klara Modin
  Cc: linux-riscv, paul.walmsley, palmer, aou, alex, conor.dooley,
	valentina.fernandezalanis, linux-kernel, stable

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@dabbelt.com>:

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_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.
> 
> [...]

Here is the summary with links:
  - riscv: export boot_cpu_hartid
    https://git.kernel.org/riscv/c/c5136add3f9b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-24  3:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 12:58 [PATCH] riscv: export boot_cpu_hartid Klara Modin
2025-06-19 10:25 ` Conor Dooley
2025-06-23 23:35   ` Palmer Dabbelt
2025-06-24  0:50 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox