ARM: conditionally allow master CPU hotplugging
PATCH 1/2 ARM: conditionally allow master CPU hotplugging
Currently all CPUs are marked as hotpluggable in topology_init(). This is not true for all ARM SMP platforms including OMAP4. In the OMAP4 case, CPU0 is considered as privileged due to TrustZone software and other considerations.
This patch introduces a new config option, HOTPLUG_CPU_MASTER, which prevents the first CPU in possible_cpu_mask from being marked hotpluggable if set.
Signed-off-by Mike Turquette <[email protected]>
--- arch/arm/Kconfig | 8 ++++++++ arch/arm/kernel/setup.c | 5 +++++ 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/Kconfig +8 -0
@@ -1393,6 +1393,14 @@ config HOTPLUG_CPU Say Y here to experiment with turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. +config HOTPLUG_CPU_MASTER + bool "Prevent first CPU (master) from hotplugging" + depends on HOTPLUG_CPU + help + Say Y here if your platform treats the first CPU as a special + "master" CPU and cannot allow it to hotplug. This prevents the + "online" entry in sysfs for that CPU. + config LOCAL_TIMERS bool "Use local timer interrupts" depends on SMP
arch/arm/kernel/setup.c +5 -0
@@ -940,7 +940,12 @@ static int __init topology_init(void)for_each_possible_cpu (cpu) {struct cpuinfo_arm *cpuinfo =3D &per_cpu (cpu_data, cpu); +#ifdef CONFIG_HOTPLUG_CPU_MASTER +if (cpu) + cpuinfo->cpu.hotpluggable =3D 1; +#else cpuinfo->cpu.hotpluggable =3D 1; +#endif register_cpu (&cpuinfo->cpu, cpu); }
--=20
1.7.4.1
and,