* [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration
@ 2023-09-14 14:51 Russell King (Oracle)
2023-09-15 19:09 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Russell King (Oracle) @ 2023-09-14 14:51 UTC (permalink / raw)
To: linux-acpi, James Morse
Cc: loongarch, linux-arch, linux-arm-kernel, linux-kernel, linux-pm,
Thomas Gleixner, Ingo Molnar, Jean-Philippe Brucker, jianyong.wu,
justin.he, Borislav Petkov, Dave Hansen, Salil Mehta, x86,
H. Peter Anvin, Peter Zijlstra, linux-ia64
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.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
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/20230913163823.7880-2-james.morse@arm.com
https://lore.kernel.org/r/20230913163823.7880-4-james.morse@arm.com
https://lore.kernel.org/r/20230913163823.7880-23-james.morse@arm.com
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(-)
diff --git a/arch/ia64/include/asm/cpu.h b/arch/ia64/include/asm/cpu.h
index db125df9e088..642d71675ddb 100644
--- a/arch/ia64/include/asm/cpu.h
+++ b/arch/ia64/include/asm/cpu.h
@@ -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_ */
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 94a848b06f15..741863a187a6 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -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);
}
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 3a233ebff712..25050d953eee 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -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
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0abd60a7987b..eb768a866fe3 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -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);
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration
2023-09-14 14:51 [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration Russell King (Oracle)
@ 2023-09-15 19:09 ` Thomas Gleixner
2023-09-18 8:16 ` Russell King (Oracle)
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2023-09-15 19:09 UTC (permalink / raw)
To: Russell King (Oracle), linux-acpi, James Morse
Cc: loongarch, linux-arch, linux-arm-kernel, linux-kernel, linux-pm,
Ingo Molnar, Jean-Philippe Brucker, jianyong.wu, justin.he,
Borislav Petkov, Dave Hansen, Salil Mehta, x86, H. Peter Anvin,
Peter Zijlstra, linux-ia64
On Thu, Sep 14 2023 at 15:51, Russell King wrote:
> 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.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> 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.
And it makes tons of sense.
> See:
> https://lore.kernel.org/r/20230913163823.7880-2-james.morse@arm.com
> https://lore.kernel.org/r/20230913163823.7880-4-james.morse@arm.com
> https://lore.kernel.org/r/20230913163823.7880-23-james.morse@arm.com
>
> v2: lets try not fat-fingering vim.
Yeah. I wondered how you managed to mangle that :)
> arch/ia64/include/asm/cpu.h | 5 -----
> arch/ia64/kernel/topology.c | 2 +-
That's moot as ia64 is queued for removal :)
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration
2023-09-15 19:09 ` Thomas Gleixner
@ 2023-09-18 8:16 ` Russell King (Oracle)
2023-09-25 16:28 ` Russell King (Oracle)
0 siblings, 1 reply; 4+ messages in thread
From: Russell King (Oracle) @ 2023-09-18 8:16 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linux-acpi, James Morse, loongarch, linux-arch, linux-arm-kernel,
linux-kernel, linux-pm, Ingo Molnar, Jean-Philippe Brucker,
jianyong.wu, justin.he, Borislav Petkov, Dave Hansen, Salil Mehta,
x86, H. Peter Anvin, Peter Zijlstra, linux-ia64
On Fri, Sep 15, 2023 at 09:09:10PM +0200, Thomas Gleixner wrote:
> On Thu, Sep 14 2023 at 15:51, Russell King wrote:
> > 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.
> >
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> > 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.
>
> And it makes tons of sense.
>
> > See:
> > https://lore.kernel.org/r/20230913163823.7880-2-james.morse@arm.com
> > https://lore.kernel.org/r/20230913163823.7880-4-james.morse@arm.com
> > https://lore.kernel.org/r/20230913163823.7880-23-james.morse@arm.com
> >
> > v2: lets try not fat-fingering vim.
>
> Yeah. I wondered how you managed to mangle that :)
>
> > 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.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration
2023-09-18 8:16 ` Russell King (Oracle)
@ 2023-09-25 16:28 ` Russell King (Oracle)
0 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2023-09-25 16:28 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linux-acpi, James Morse, loongarch, linux-arch, linux-arm-kernel,
linux-kernel, linux-pm, Ingo Molnar, Jean-Philippe Brucker,
jianyong.wu, justin.he, Borislav Petkov, Dave Hansen, Salil Mehta,
x86, H. Peter Anvin, Peter Zijlstra, linux-ia64
On Mon, Sep 18, 2023 at 09:16:18AM +0100, Russell King (Oracle) wrote:
> On Fri, Sep 15, 2023 at 09:09:10PM +0200, Thomas Gleixner wrote:
> > On Thu, Sep 14 2023 at 15:51, Russell King wrote:
> > > 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.
> > >
> > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > > ---
> > > 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.
> >
> > And it makes tons of sense.
> >
> > > See:
> > > https://lore.kernel.org/r/20230913163823.7880-2-james.morse@arm.com
> > > https://lore.kernel.org/r/20230913163823.7880-4-james.morse@arm.com
> > > https://lore.kernel.org/r/20230913163823.7880-23-james.morse@arm.com
> > >
> > > v2: lets try not fat-fingering vim.
> >
> > Yeah. I wondered how you managed to mangle that :)
> >
> > > 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.
It's been totally quiet for a week both from James and from Thomas,
I'll send the patch with the ia64 bits dropped.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-25 16:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 14:51 [PATCH RFC v2] cpu-hotplug: provide prototypes for arch CPU registration Russell King (Oracle)
2023-09-15 19:09 ` Thomas Gleixner
2023-09-18 8:16 ` Russell King (Oracle)
2023-09-25 16:28 ` Russell King (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).