[PATCH v2] powerpc: export cpu_to_core_id()
Guilherme G. Piccoli
gpiccoli at linux.vnet.ibm.com
Tue Jun 7 08:04:15 AEST 2016
On 06/02/2016 08:45 AM, Mauricio Faria de Oliveira wrote:
> Export cpu_to_core_id(). This will be used by the lpfc driver.
>
> This enables topology_core_id() from <linux/topology.h> (defined
> to cpu_to_core_id() in arch/powerpc/include/asm/topology.h) to be
> used by (non-builtin) modules.
>
> That is arch-neutral, already used by eg, drivers/base/topology.c,
> but it is builtin (obj-y in Makefile) thus didn't need the export.
>
> Since the module uses topology_core_id() and this is defined to
> cpu_to_core_id(), it needs the export, otherwise:
>
> ERROR: "cpu_to_core_id" [drivers/scsi/lpfc/lpfc.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
>
> Tested on next-20160601.
>
> Changelog:
> - v2: include details about the need for this patch with regards
> to the architecture-neutral topology API.
>
> Signed-off-by: Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/smp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 55c924b..67136e7 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -593,6 +593,7 @@ out:
> of_node_put(np);
> return id;
> }
> +EXPORT_SYMBOL_GPL(cpu_to_core_id);
>
> /* Helper routines for cpu to core mapping */
> int cpu_core_index_of_thread(int cpu)
>
Hi MaurĂcio, I'm planning to use this in another driver heheh
Thanks for exporting the symbol.
I built a kernel with your patch and it's working fine, so you can add:
"Tested-by: Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>"
Cheers,
Guilherme
More information about the Linuxppc-dev
mailing list