* [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES
@ 2024-07-02 7:57 Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 1/2] ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Jinjie Ruan
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jinjie Ruan @ 2024-07-02 7:57 UTC (permalink / raw)
To: linux, arnd, afd, akpm, linus.walleij, eric.devolder, ardb,
gregkh, deller, javierm, bhe, robh, linux-kernel,
linux-arm-kernel
Cc: ruanjinjie
Currently, almost all architectures have switched to GENERIC_CPU_DEVICES,
except for arm32. Also switch over to GENERIC_CPU_DEVICES, which can also
make the code more concise.
Jinjie Ruan (2):
ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
ARM: Convert to arch_cpu_is_hotpluggable()
arch/arm/Kconfig | 1 +
arch/arm/include/asm/cpu.h | 1 -
arch/arm/kernel/setup.c | 14 ++------------
3 files changed, 3 insertions(+), 13 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND 1/2] ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
2024-07-02 7:57 [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
@ 2024-07-02 7:57 ` Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 2/2] ARM: Convert to arch_cpu_is_hotpluggable() Jinjie Ruan
2024-07-31 1:52 ` [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2024-07-02 7:57 UTC (permalink / raw)
To: linux, arnd, afd, akpm, linus.walleij, eric.devolder, ardb,
gregkh, deller, javierm, bhe, robh, linux-kernel,
linux-arm-kernel
Cc: ruanjinjie
Currently, almost all architectures have switched to GENERIC_CPU_DEVICES,
except for arm32. Also switch over to GENERIC_CPU_DEVICES, and provide an
arch_register_cpu() that populates the hotpluggable flag for arm32.
The struct cpu in struct cpuinfo_arm is never used directly, remove
it to use the one GENERIC_CPU_DEVICES provides.
This also has the effect of moving the registration of CPUs from subsys to
driver core initialisation, prior to any initcalls running.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm/Kconfig | 1 +
arch/arm/include/asm/cpu.h | 1 -
arch/arm/kernel/setup.c | 15 ++++-----------
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b211b7f5a138..68990e1645d5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -63,6 +63,7 @@ config ARM
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IRQ_IPI if SMP
select GENERIC_CPU_AUTOPROBE
+ select GENERIC_CPU_DEVICES
select GENERIC_EARLY_IOREMAP
select GENERIC_IDLE_POLL_SETUP
select GENERIC_IRQ_MULTI_HANDLER
diff --git a/arch/arm/include/asm/cpu.h b/arch/arm/include/asm/cpu.h
index bd6fdb4b922d..9d8863537aa5 100644
--- a/arch/arm/include/asm/cpu.h
+++ b/arch/arm/include/asm/cpu.h
@@ -11,7 +11,6 @@
#include <linux/cpu.h>
struct cpuinfo_arm {
- struct cpu cpu;
u32 cpuid;
#ifdef CONFIG_SMP
unsigned int loops_per_jiffy;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7b33b157fca0..f91e2b5b8b20 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1201,20 +1201,13 @@ void __init setup_arch(char **cmdline_p)
mdesc->init_early();
}
-
-static int __init topology_init(void)
+int arch_register_cpu(int num)
{
- int cpu;
-
- for_each_possible_cpu(cpu) {
- struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu);
- cpuinfo->cpu.hotpluggable = platform_can_hotplug_cpu(cpu);
- register_cpu(&cpuinfo->cpu, cpu);
- }
+ struct cpu *cpu = &per_cpu(cpu_devices, num);
- return 0;
+ cpu->hotpluggable = platform_can_hotplug_cpu(num);
+ return register_cpu(cpu, num);
}
-subsys_initcall(topology_init);
#ifdef CONFIG_HAVE_PROC_CPU
static int __init proc_cpu_init(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH RESEND 2/2] ARM: Convert to arch_cpu_is_hotpluggable()
2024-07-02 7:57 [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 1/2] ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Jinjie Ruan
@ 2024-07-02 7:57 ` Jinjie Ruan
2024-07-31 1:52 ` [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2024-07-02 7:57 UTC (permalink / raw)
To: linux, arnd, afd, akpm, linus.walleij, eric.devolder, ardb,
gregkh, deller, javierm, bhe, robh, linux-kernel,
linux-arm-kernel
Cc: ruanjinjie
Convert arm32 to use the arch_cpu_is_hotpluggable() helper rather than
arch_register_cpu().
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
arch/arm/kernel/setup.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index f91e2b5b8b20..e6a857bf0ce6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1201,12 +1201,9 @@ void __init setup_arch(char **cmdline_p)
mdesc->init_early();
}
-int arch_register_cpu(int num)
+bool arch_cpu_is_hotpluggable(int num)
{
- struct cpu *cpu = &per_cpu(cpu_devices, num);
-
- cpu->hotpluggable = platform_can_hotplug_cpu(num);
- return register_cpu(cpu, num);
+ return platform_can_hotplug_cpu(num);
}
#ifdef CONFIG_HAVE_PROC_CPU
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES
2024-07-02 7:57 [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 1/2] ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 2/2] ARM: Convert to arch_cpu_is_hotpluggable() Jinjie Ruan
@ 2024-07-31 1:52 ` Jinjie Ruan
2024-07-31 8:27 ` Russell King (Oracle)
2 siblings, 1 reply; 6+ messages in thread
From: Jinjie Ruan @ 2024-07-31 1:52 UTC (permalink / raw)
To: linux, arnd, afd, akpm, linus.walleij, eric.devolder, ardb,
gregkh, deller, javierm, bhe, robh, linux-kernel,
linux-arm-kernel
Gentle ping.
On 2024/7/2 15:57, Jinjie Ruan wrote:
> Currently, almost all architectures have switched to GENERIC_CPU_DEVICES,
> except for arm32. Also switch over to GENERIC_CPU_DEVICES, which can also
> make the code more concise.
>
> Jinjie Ruan (2):
> ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
> ARM: Convert to arch_cpu_is_hotpluggable()
>
> arch/arm/Kconfig | 1 +
> arch/arm/include/asm/cpu.h | 1 -
> arch/arm/kernel/setup.c | 14 ++------------
> 3 files changed, 3 insertions(+), 13 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES
2024-07-31 1:52 ` [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
@ 2024-07-31 8:27 ` Russell King (Oracle)
2024-07-31 8:57 ` Jinjie Ruan
0 siblings, 1 reply; 6+ messages in thread
From: Russell King (Oracle) @ 2024-07-31 8:27 UTC (permalink / raw)
To: Jinjie Ruan
Cc: arnd, afd, akpm, linus.walleij, eric.devolder, ardb, gregkh,
deller, javierm, bhe, robh, linux-kernel, linux-arm-kernel
On Wed, Jul 31, 2024 at 09:52:07AM +0800, Jinjie Ruan wrote:
> On 2024/7/2 15:57, Jinjie Ruan wrote:
> > Currently, almost all architectures have switched to GENERIC_CPU_DEVICES,
> > except for arm32. Also switch over to GENERIC_CPU_DEVICES, which can also
> > make the code more concise.
> >
> > Jinjie Ruan (2):
> > ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
> > ARM: Convert to arch_cpu_is_hotpluggable()
> >
> > arch/arm/Kconfig | 1 +
> > arch/arm/include/asm/cpu.h | 1 -
> > arch/arm/kernel/setup.c | 14 ++------------
> > 3 files changed, 3 insertions(+), 13 deletions(-)
I think it's fine, but it needs to end up in the patch system to be
applied. Thanks.
--
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] 6+ messages in thread
* Re: [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES
2024-07-31 8:27 ` Russell King (Oracle)
@ 2024-07-31 8:57 ` Jinjie Ruan
0 siblings, 0 replies; 6+ messages in thread
From: Jinjie Ruan @ 2024-07-31 8:57 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: arnd, afd, akpm, linus.walleij, eric.devolder, ardb, gregkh,
deller, javierm, bhe, robh, linux-kernel, linux-arm-kernel
On 2024/7/31 16:27, Russell King (Oracle) wrote:
> On Wed, Jul 31, 2024 at 09:52:07AM +0800, Jinjie Ruan wrote:
>> On 2024/7/2 15:57, Jinjie Ruan wrote:
>>> Currently, almost all architectures have switched to GENERIC_CPU_DEVICES,
>>> except for arm32. Also switch over to GENERIC_CPU_DEVICES, which can also
>>> make the code more concise.
>>>
>>> Jinjie Ruan (2):
>>> ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
>>> ARM: Convert to arch_cpu_is_hotpluggable()
>>>
>>> arch/arm/Kconfig | 1 +
>>> arch/arm/include/asm/cpu.h | 1 -
>>> arch/arm/kernel/setup.c | 14 ++------------
>>> 3 files changed, 3 insertions(+), 13 deletions(-)
>
> I think it's fine, but it needs to end up in the patch system to be
> applied. Thanks.
Hi, Russell
Thank you very much! I'll push it in rmk's patch tracker sooner.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-31 8:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 7:57 [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 1/2] ARM: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() Jinjie Ruan
2024-07-02 7:57 ` [PATCH RESEND 2/2] ARM: Convert to arch_cpu_is_hotpluggable() Jinjie Ruan
2024-07-31 1:52 ` [PATCH RESEND 0/2] ARM: Switch over to GENERIC_CPU_DEVICES Jinjie Ruan
2024-07-31 8:27 ` Russell King (Oracle)
2024-07-31 8:57 ` Jinjie Ruan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.