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) <[email protected]>
---
Changes since RFC v2:
- drop ia64 changes, as ia64 has already been removed.
arch/x86/include/asm/cpu.h | 2 --
arch/x86/kernel/topology.c | 2 +-
include/linux/cpu.h | 2 ++
3 files changed, 3 insertions(+), 3 deletions(-)
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/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index ca004e2e4469..0bab03130033 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
EXPORT_SYMBOL(arch_unregister_cpu);
#else /* CONFIG_HOTPLUG_CPU */
-static int __init arch_register_cpu(int num)
+int __init arch_register_cpu(int num)
{
return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
}
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
On Tue, Sep 26, 2023 at 09:04:46AM +1000, Gavin Shan wrote:
> Hi Russell,
>
> On 9/26/23 02:28, Russell King (Oracle) 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) <[email protected]>
> > ---
> > Changes since RFC v2:
> > - drop ia64 changes, as ia64 has already been removed.
> >
> > arch/x86/include/asm/cpu.h | 2 --
> > arch/x86/kernel/topology.c | 2 +-
> > include/linux/cpu.h | 2 ++
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
>
> In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.
Correct, but I have been told that IA64 has been removed, so I removed
those changes from my patch.
> They may have been dropped in other ia64 or x86 git repository, which this patch
> bases on.
I have no idea which repository they have been dropped from. I only know
what tglx told me, and despite asking the question, I never got any
answer. So I've done the best I can with this patch. If kernel devs want
to state things in vague terms, and then go silent when asked questions
to elaborate, then that leads to guessing.
Maybe someone else should adapt this patch to apply to whatever tree it
is going to end up being applied to - because I have no idea _which_
tree it'll end up being applied to.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Hi Russell,
On 9/26/23 02:28, Russell King (Oracle) 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) <[email protected]>
> ---
> Changes since RFC v2:
> - drop ia64 changes, as ia64 has already been removed.
>
> arch/x86/include/asm/cpu.h | 2 --
> arch/x86/kernel/topology.c | 2 +-
> include/linux/cpu.h | 2 ++
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.
They may have been dropped in other ia64 or x86 git repository, which this patch
bases on.
In the commit message, 'static' from one of ia64's arch_register_cpu() definitions
is removed, but there is no changes related to ia64 in this patch. I guess that's
probably x86?
> 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/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
> index ca004e2e4469..0bab03130033 100644
> --- a/arch/x86/kernel/topology.c
> +++ b/arch/x86/kernel/topology.c
> @@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
> EXPORT_SYMBOL(arch_unregister_cpu);
> #else /* CONFIG_HOTPLUG_CPU */
>
> -static int __init arch_register_cpu(int num)
> +int __init arch_register_cpu(int num)
> {
> return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
> }
I think arch/ia64/kernel/topology.c may need same change, as stated in the commit log.
In linux 6.6.rc3, 'static' exists in arch/ia64/kernel/topology.c::arch_register_cpu().
Again, your patch may have been based on other git repository.
> 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);
Thanks,
Gavin
On Tue, Sep 26, 2023 at 12:17:19AM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 26, 2023 at 09:04:46AM +1000, Gavin Shan wrote:
> > Hi Russell,
> >
> > On 9/26/23 02:28, Russell King (Oracle) 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) <[email protected]>
> > > ---
> > > Changes since RFC v2:
> > > - drop ia64 changes, as ia64 has already been removed.
> > >
> > > arch/x86/include/asm/cpu.h | 2 --
> > > arch/x86/kernel/topology.c | 2 +-
> > > include/linux/cpu.h | 2 ++
> > > 3 files changed, 3 insertions(+), 3 deletions(-)
> > >
> >
> > In Linux 6.6.rc3, the prototypes are still existing in arch/ia64/include/asm/cpu.h.
>
> Correct, but I have been told that IA64 has been removed, so I removed
> those changes from my patch.
>
> > They may have been dropped in other ia64 or x86 git repository, which this patch
> > bases on.
>
> I have no idea which repository they have been dropped from. I only know
> what tglx told me, and despite asking the question, I never got any
> answer. So I've done the best I can with this patch. If kernel devs want
> to state things in vague terms, and then go silent when asked questions
> to elaborate, then that leads to guessing.
>
> Maybe someone else should adapt this patch to apply to whatever tree it
> is going to end up being applied to - because I have no idea _which_
> tree it'll end up being applied to.
So, is this how the Linux community is now dysfunctional?
Someone sends a patch.
Thomas reviews, says it's a good idea and provides some feedback.
Author asks questions, gets ignored.
Author sends a patch taking in to account that previous feedback.
Someone else replies, contradicting the previous feedback.
Nothing else happens.
What a bloody sorry state of affairs.
Makes me wonder what the point of trying to contribute to the Linux
kernel outside of the areas I actually maintain anymore is.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
On 10/3/2023 7:34 AM, Russell King (Oracle) wrote:
>>>>
>>>> Signed-off-by: Russell King (Oracle) <[email protected]>
>>>> ---
>>>> Changes since RFC v2:
>>>> - drop ia64 changes, as ia64 has already been removed.
>>>>
If this is RFC v2, we put "RFC v2" in the subject, then people know you
are sending a newer version. People are busy, and your patch could be
skipped if it appears the same as a previous one.
On Tue, Oct 03, 2023 at 10:37:02AM -0700, Xin Li wrote:
> On 10/3/2023 7:34 AM, Russell King (Oracle) wrote:
> > > > >
> > > > > Signed-off-by: Russell King (Oracle) <[email protected]>
> > > > > ---
> > > > > Changes since RFC v2:
> > > > > - drop ia64 changes, as ia64 has already been removed.
> > > > >
>
> If this is RFC v2, we put "RFC v2" in the subject, then people know you
> are sending a newer version.
Sorry, but this is yet another illustration why the kernel process is
broken. Clearly, people do NOT bother reading what is actually written,
but instead make up in their minds something completely different.
This is *NOT* RFC v2. This is RFC v2:
https://lore.kernel.org/all/[email protected]/
And what I wrote was "changes **** SINCE **** RFC v2". For those who
find English difficult, this means that what follows is the list of
changes that are in THIS posting that WERE NOT IN THE PREVIOUS POSTING
which was RFC v2.
Thanks for making me even more frustrated than I was.
> People are busy, and your patch could be
> skipped if it appears the same as a previous one.
Yet another reason why the kernel process is just completely broken.
"appears to be". Even when the changes are spelled out. Yes, right,
people don't have time to read. If that's the case, then it's a
waste of time adding a change log. It's a waste of time to add a
commit message. In fact, it's a total waste of time trying to
contribute to a rotten-to-the-core open source project that Linux
seems to have turned into.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Okay, I give up. 15 days, still no real progress. I don't see any point
in submitting any further patches for the kernel outside of those areas
that I maintain. Clearly no one cares enough to bother (a) properly
reviewing the patch, (b) applying the patch that Thomas thought
"makes tons of sense."
If patches that "makes tons of sense" just get ignored, then what does
the future of the kernel hold? Crap, that's what, utter crap.
As I said, it seems that the Linux kernel process is basically totally
broken and rotten. If a six line patch that "makes tons of sense" can't
be applied, then there's basically no hope what so ever.
FFS.
On Mon, Sep 25, 2023 at 05:28:39PM +0100, Russell King (Oracle) 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) <[email protected]>
> ---
> Changes since RFC v2:
> - drop ia64 changes, as ia64 has already been removed.
>
> arch/x86/include/asm/cpu.h | 2 --
> arch/x86/kernel/topology.c | 2 +-
> include/linux/cpu.h | 2 ++
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> 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/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
> index ca004e2e4469..0bab03130033 100644
> --- a/arch/x86/kernel/topology.c
> +++ b/arch/x86/kernel/topology.c
> @@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
> EXPORT_SYMBOL(arch_unregister_cpu);
> #else /* CONFIG_HOTPLUG_CPU */
>
> -static int __init arch_register_cpu(int num)
> +int __init arch_register_cpu(int num)
> {
> return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
> }
> 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
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
On Tue, Oct 10 2023 at 17:23, Russell King wrote:
> Okay, I give up. 15 days, still no real progress. I don't see any point
> in submitting any further patches for the kernel outside of those areas
> that I maintain. Clearly no one cares enough to bother (a) properly
> reviewing the patch, (b) applying the patch that Thomas thought
> "makes tons of sense."
>
> If patches that "makes tons of sense" just get ignored, then what does
> the future of the kernel hold? Crap, that's what, utter crap.
>
> As I said, it seems that the Linux kernel process is basically totally
> broken and rotten. If a six line patch that "makes tons of sense" can't
> be applied, then there's basically no hope what so ever.
Oh well. I usually try to keep track of such stuff, but this one fell
through the cracks.
Shit happens and we are all human, no?
Sorry for the wrong information about ia64. The removal did not happen
because someone stepped up as a possible maintainer.
Thanks,
tglx
The following commit has been merged into the smp/urgent branch of tip:
Commit-ID: c4dd854f740c21ae8dd9903fc67969c5497cb14b
Gitweb: https://git.kernel.org/tip/c4dd854f740c21ae8dd9903fc67969c5497cb14b
Author: Russell King (Oracle) <[email protected]>
AuthorDate: Mon, 25 Sep 2023 17:28:39 +01:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Wed, 11 Oct 2023 14:27:37 +02:00
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, do the job once for everyone.
Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and therefore remove the 'static' from one of ia64's
arch_register_cpu() definitions.
[ tglx: Bring back the ia64 part and remove the ACPI prototypes ]
Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/ia64/include/asm/cpu.h | 5 -----
arch/ia64/kernel/topology.c | 2 +-
arch/x86/include/asm/cpu.h | 2 --
arch/x86/kernel/topology.c | 2 +-
drivers/acpi/acpi_processor.c | 1 +
include/acpi/processor.h | 5 -----
include/linux/cpu.h | 2 ++
7 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/arch/ia64/include/asm/cpu.h b/arch/ia64/include/asm/cpu.h
index db125df..642d716 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 94a848b..741863a 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 3a233eb..25050d9 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/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index ca004e2..0bab031 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
EXPORT_SYMBOL(arch_unregister_cpu);
#else /* CONFIG_HOTPLUG_CPU */
-static int __init arch_register_cpu(int num)
+int __init arch_register_cpu(int num)
{
return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
}
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index c711db8..0f5218e 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -12,6 +12,7 @@
#define pr_fmt(fmt) "ACPI: " fmt
#include <linux/acpi.h>
+#include <linux/cpu.h>
#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/kernel.h>
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 94181fe..3f34ebb 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -465,9 +465,4 @@ extern int acpi_processor_ffh_lpi_probe(unsigned int cpu);
extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
#endif
-#ifdef CONFIG_ACPI_HOTPLUG_CPU
-extern int arch_register_cpu(int cpu);
-extern void arch_unregister_cpu(int cpu);
-#endif
-
#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0abd60a..eb768a8 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);
Hello Thomas,
st 11. 10. 2023 v 14:06 odesílatel Thomas Gleixner <[email protected]> napsal:
>
> Sorry for the wrong information about ia64. The removal did not happen
> because someone stepped up as a possible maintainer.
>
Does that mean that the removal patch will be reverted soon in
asm-generic and linux-next? Both have no ia64 as of now, and there are
already a few patches without ia64 part (e,g,
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/commit/?id=2fd0ebad27bcd4c8fc61c61a98d4283c47054bcf).
Without the revert, patches affecting ia64 will conflict.
I am the person who volunteered to maintain the architecture. If the
removal was indeed cancelled, me and Frank Scheiner can start testing
and reviewing patches affecting ia64.
Thanks,
Tomas