]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ARM: 9411/1: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
authorJinjie Ruan <ruanjinjie@huawei.com>
Wed, 31 Jul 2024 09:17:55 +0000 (10:17 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 20 Aug 2024 10:18:49 +0000 (11:18 +0100)
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>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/Kconfig
arch/arm/include/asm/cpu.h
arch/arm/kernel/setup.c

index 54b2bb817a7fc0615ad94b88fd4698512f29c0c5..bd2b91f6b6cf6b0da0d2385b6c6c86cdf0a14133 100644 (file)
@@ -64,6 +64,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
index bd6fdb4b922d49f5b40f7e5d984d078ae544bebe..9d8863537aa5a8d7d03499d572b5cd05b0197042 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/cpu.h>
 
 struct cpuinfo_arm {
-       struct cpu      cpu;
        u32             cpuid;
 #ifdef CONFIG_SMP
        unsigned int    loops_per_jiffy;
index 7b33b157fca0dc2007b5cbb714d7d15c6459bfb2..f91e2b5b8b201a5b6c172e872b3fec515908adea 100644 (file)
@@ -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)