[PATCH v3 2/4] riscv: export __cpuid_to_hartid_map

Valentina Fernandez posted 4 patches 2 weeks, 4 days ago
[PATCH v3 2/4] riscv: export __cpuid_to_hartid_map
Posted by Valentina Fernandez 2 weeks, 4 days ago
EXPORT_SYMBOL_GPL() is missing for __cpuid_to_hartid_map array.
Export this symbol to allow drivers compiled as modules to use
cpuid_to_hartid_map().

Signed-off-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
---
 arch/riscv/kernel/smp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index c180a647a30e..d58b5e751286 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -43,6 +43,7 @@ enum ipi_message_type {
 unsigned long __cpuid_to_hartid_map[NR_CPUS] __ro_after_init = {
 	[0 ... NR_CPUS-1] = INVALID_HARTID
 };
+EXPORT_SYMBOL_GPL(__cpuid_to_hartid_map);
 
 void __init smp_setup_processor_id(void)
 {
-- 
2.34.1
Re: [PATCH v3 2/4] riscv: export __cpuid_to_hartid_map
Posted by Rob Herring 1 week, 5 days ago
On Tue, Nov 05, 2024 at 06:35:11PM +0000, Valentina Fernandez wrote:
> EXPORT_SYMBOL_GPL() is missing for __cpuid_to_hartid_map array.
> Export this symbol to allow drivers compiled as modules to use
> cpuid_to_hartid_map().
> 
> Signed-off-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
> ---
>  arch/riscv/kernel/smp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
> index c180a647a30e..d58b5e751286 100644
> --- a/arch/riscv/kernel/smp.c
> +++ b/arch/riscv/kernel/smp.c
> @@ -43,6 +43,7 @@ enum ipi_message_type {
>  unsigned long __cpuid_to_hartid_map[NR_CPUS] __ro_after_init = {
>  	[0 ... NR_CPUS-1] = INVALID_HARTID
>  };
> +EXPORT_SYMBOL_GPL(__cpuid_to_hartid_map);

Why can't riscv implement cpu_logical_map() like other arches?

We really should have a common implementation too, but that's probably 
too much to ask I guess.

Rob
Re: [PATCH v3 2/4] riscv: export __cpuid_to_hartid_map
Posted by Atish Patra 4 days, 15 hours ago
On Mon, Nov 11, 2024 at 1:52 PM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Nov 05, 2024 at 06:35:11PM +0000, Valentina Fernandez wrote:
> > EXPORT_SYMBOL_GPL() is missing for __cpuid_to_hartid_map array.
> > Export this symbol to allow drivers compiled as modules to use
> > cpuid_to_hartid_map().
> >
> > Signed-off-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
> > ---
> >  arch/riscv/kernel/smp.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
> > index c180a647a30e..d58b5e751286 100644
> > --- a/arch/riscv/kernel/smp.c
> > +++ b/arch/riscv/kernel/smp.c
> > @@ -43,6 +43,7 @@ enum ipi_message_type {
> >  unsigned long __cpuid_to_hartid_map[NR_CPUS] __ro_after_init = {
> >       [0 ... NR_CPUS-1] = INVALID_HARTID
> >  };
> > +EXPORT_SYMBOL_GPL(__cpuid_to_hartid_map);
>
> Why can't riscv implement cpu_logical_map() like other arches?
>

We can and we should :)

> We really should have a common implementation too, but that's probably
> too much to ask I guess.
>
> Rob
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv



-- 
Regards,
Atish