Skip to content

Commit 609face

Browse files
Jinjie RuanRussell King (Oracle)
authored andcommitted
ARM: 9411/1: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu()
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 <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 89a906d commit 609face

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config ARM
6464
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
6565
select GENERIC_IRQ_IPI if SMP
6666
select GENERIC_CPU_AUTOPROBE
67+
select GENERIC_CPU_DEVICES
6768
select GENERIC_EARLY_IOREMAP
6869
select GENERIC_IDLE_POLL_SETUP
6970
select GENERIC_IRQ_MULTI_HANDLER

arch/arm/include/asm/cpu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/cpu.h>
1212

1313
struct cpuinfo_arm {
14-
struct cpu cpu;
1514
u32 cpuid;
1615
#ifdef CONFIG_SMP
1716
unsigned int loops_per_jiffy;

arch/arm/kernel/setup.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,20 +1201,13 @@ void __init setup_arch(char **cmdline_p)
12011201
mdesc->init_early();
12021202
}
12031203

1204-
1205-
static int __init topology_init(void)
1204+
int arch_register_cpu(int num)
12061205
{
1207-
int cpu;
1208-
1209-
for_each_possible_cpu(cpu) {
1210-
struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu);
1211-
cpuinfo->cpu.hotpluggable = platform_can_hotplug_cpu(cpu);
1212-
register_cpu(&cpuinfo->cpu, cpu);
1213-
}
1206+
struct cpu *cpu = &per_cpu(cpu_devices, num);
12141207

1215-
return 0;
1208+
cpu->hotpluggable = platform_can_hotplug_cpu(num);
1209+
return register_cpu(cpu, num);
12161210
}
1217-
subsys_initcall(topology_init);
12181211

12191212
#ifdef CONFIG_HAVE_PROC_CPU
12201213
static int __init proc_cpu_init(void)

0 commit comments

Comments
 (0)