cpu-hotplug: provide prototypes for arch CPU registration
Subsystems (5)
RFC PATCH v2 1/1 cpu-hotplug: provide prototypes for arch CPU registration
Provide common prototypes for arch_register_cpu() and arch_unregister_cpu(). These are called by acpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros.
Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's asm/cpu.h, lets do the job once for everyone.
Since this covers everyone, remove the now unnecessary prototypes in asm/cpu.h, and we also need to remove the 'static' from one of ia64's arch_register_cpu() definitions.
---
Spotted during the review of James Morse's patches, I think rather than adding prototypes for loongarch to its asm/cpu.h, it would make more sense to provide the prototypes in a non-arch specific header file so everyone can benefit, rather than having each architecture do its own thing.
I'm sending this as RFC as James has yet to comment on my proposal, and also to a wider audience, and although it makes a little more work for James (to respin his series) it does mean that his series should get a little smaller.
See:
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
v2: lets try not fat-fingering vim.
arch/ia64/include/asm/cpu.h | 5 ----- arch/ia64/kernel/topology.c | 2 +- arch/x86/include/asm/cpu.h | 2 -- include/linux/cpu.h | 2 ++ 4 files changed, 3 insertions(+), 8 deletions(-)
arch/ia64/include/asm/cpu.h +0 -5
@@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);DECLARE_PER_CPU (int, cpu_state); -#ifdef CONFIG_HOTPLUG_CPU -extern int arch_register_cpu (int num); -extern void arch_unregister_cpu (int ); -#endif -#endif /* _ASM_IA64_CPU_H_ */
arch/ia64/kernel/topology.c +1 -1
@@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num) }EXPORT_SYMBOL (arch_unregister_cpu);#else -static int __init arch_register_cpu (int num) +int __init arch_register_cpu (int num) {return register_cpu (&sysfs_cpus[num].cpu, num); }
arch/x86/include/asm/cpu.h +0 -2
@@ -28,8 +28,6 @@ struct x86_cpu { };#ifdef CONFIG_HOTPLUG_CPU -extern int arch_register_cpu (int num); -extern void arch_unregister_cpu (int );extern void soft_restart_cpu (void );#endif
include/linux/cpu.h +2 -0
@@ -80,6 +80,8 @@ extern __printf(4, 5)struct device *cpu_device_create (struct device *parent,void *drvdata,const struct attribute_group **groups,const char *fmt, ...); +extern int arch_register_cpu (int cpu); +extern void arch_unregister_cpu (int cpu);#ifdef CONFIG_HOTPLUG_CPU extern void unregister_cpu (struct cpu *cpu);extern ssize_t arch_cpu_probe (const char *,size_t );
Signature · 1 line
2.30.2
Quoted 22 lines · Russell King
Provide common prototypes for
arch_register_cpu()andarch_unregister_cpu(). These are called byacpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros.Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's
asm/cpu.h, lets do the job once for everyone.Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and we also need to remove the 'static' from one of ia64'sarch_register_cpu()definitions.Signed-off-by Russell King (Oracle) <[email protected]>---
Spotted during the review of James Morse's patches, I think rather than adding prototypes for loongarch to itsasm/cpu.h, it would make more sense to provide the prototypes in a non-arch specific header file so everyone can benefit, rather than having each architecture do its own thing.
Quoted 4 lines
I'm sending this as RFC as James has yet to comment on my proposal, and also to a wider audience, and although it makes a little more work for James (to respin his series) it does mean that his series should get a little smaller.
And it makes tons of sense.
Quoted 6 lines
See:
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]v2: lets try not fat-fingering vim.
Yeah. I wondered how you managed to mangle that :)
Quoted 2 lines
arch/ia64/include/asm/cpu.h | 5 ----- arch/ia64/kernel/topology.c | 2 +-
That's moot as ia64 is queued for removal :)
Thanks,
tglx
Quoted 35 lines · Thomas Gleixner
Quoted 22 lines · Russell King
Provide common prototypes for
arch_register_cpu()andarch_unregister_cpu(). These are called byacpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros.Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's
asm/cpu.h, lets do the job once for everyone.Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and we also need to remove the 'static' from one of ia64'sarch_register_cpu()definitions.Signed-off-by Russell King (Oracle) <[email protected]>---
Spotted during the review of James Morse's patches, I think rather than adding prototypes for loongarch to itsasm/cpu.h, it would make more sense to provide the prototypes in a non-arch specific header file so everyone can benefit, rather than having each architecture do its own thing.Quoted 4 lines
I'm sending this as RFC as James has yet to comment on my proposal, and also to a wider audience, and although it makes a little more work for James (to respin his series) it does mean that his series should get a little smaller.
And it makes tons of sense.
Quoted 8 lines
Quoted 1 line
v2: lets try not fat-fingering vim.
Yeah. I wondered how you managed to mangle that :)
Quoted 2 lines
arch/ia64/include/asm/cpu.h | 5 ----- arch/ia64/kernel/topology.c | 2 +-That's moot as ia64 is queued for removal :)
Okay, one less thing to worry about. Tomorrow, I'll re-spin without the ia64 bits included.
I would really like to hear from James before we think about merging this, as it will impact James' patch set and would add a dependency for that. I wouldn't want this patch to become a reason to delay James' patch set for another kernel cycle.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Quoted 45 lines · Russell King (Oracle)
Quoted 35 lines · Thomas Gleixner
Quoted 22 lines · Russell King
Provide common prototypes for
arch_register_cpu()andarch_unregister_cpu(). These are called byacpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros.Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's
asm/cpu.h, lets do the job once for everyone.Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and we also need to remove the 'static' from one of ia64'sarch_register_cpu()definitions.Signed-off-by Russell King (Oracle) <[email protected]>---
Spotted during the review of James Morse's patches, I think rather than adding prototypes for loongarch to itsasm/cpu.h, it would make more sense to provide the prototypes in a non-arch specific header file so everyone can benefit, rather than having each architecture do its own thing.Quoted 4 lines
I'm sending this as RFC as James has yet to comment on my proposal, and also to a wider audience, and although it makes a little more work for James (to respin his series) it does mean that his series should get a little smaller.
And it makes tons of sense.
Quoted 8 lines
Quoted 1 line
v2: lets try not fat-fingering vim.
Yeah. I wondered how you managed to mangle that :)
Quoted 2 lines
arch/ia64/include/asm/cpu.h | 5 ----- arch/ia64/kernel/topology.c | 2 +-That's moot as ia64 is queued for removal :)
Quoted 7 lines
Okay, one less thing to worry about. Tomorrow, I'll re-spin without the ia64 bits included.
I would really like to hear from James before we think about merging this, as it will impact James' patch set and would add a dependency for that. I wouldn't want this patch to become a reason to delay James' patch set for another kernel cycle.
It's been totally quiet for a week both from James and from Thomas, I'll send the patch with the ia64 bits dropped.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!