aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2012-11-26 22:48:55 -0500
committerNicolas Pitre <nicolas.pitre@linaro.org>2013-08-05 00:12:41 -0400
commit272614351423ce8c37ff730efc130e5b73fe64f5 (patch)
tree58f30d7dc15915ea1022e65256732a5115117f88 /arch/arm/common
parent38c35d4f2e408c369e3030f0717d35ad443d9223 (diff)
ARM: bL_switcher: filter CPU hotplug requests when the switcher is active
Trying to support both the switcher and CPU hotplug at the same time is tricky due to ambiguous semantics. So let's at least prevent users from messing around with those logical CPUs the switcher has removed and those which were not active when the switcher was activated. Signed-off-by: Nicolas Pitre <nico@linaro.org>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/bL_switcher.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c
index 0e4fb3e5e99c..335ff76d4c5a 100644
--- a/arch/arm/common/bL_switcher.c
+++ b/arch/arm/common/bL_switcher.c
@@ -554,6 +554,26 @@ static int __init bL_switcher_sysfs_init(void)
554 554
555#endif /* CONFIG_SYSFS */ 555#endif /* CONFIG_SYSFS */
556 556
557/*
558 * Veto any CPU hotplug operation on those CPUs we've removed
559 * while the switcher is active.
560 * We're just not ready to deal with that given the trickery involved.
561 */
562static int bL_switcher_hotplug_callback(struct notifier_block *nfb,
563 unsigned long action, void *hcpu)
564{
565 if (bL_switcher_active) {
566 int pairing = bL_switcher_cpu_pairing[(unsigned long)hcpu];
567 switch (action & 0xf) {
568 case CPU_UP_PREPARE:
569 case CPU_DOWN_PREPARE:
570 if (pairing == -1)
571 return NOTIFY_BAD;
572 }
573 }
574 return NOTIFY_DONE;
575}
576
557static bool no_bL_switcher; 577static bool no_bL_switcher;
558core_param(no_bL_switcher, no_bL_switcher, bool, 0644); 578core_param(no_bL_switcher, no_bL_switcher, bool, 0644);
559 579
@@ -566,6 +586,8 @@ static int __init bL_switcher_init(void)
566 return -EINVAL; 586 return -EINVAL;
567 } 587 }
568 588
589 cpu_notifier(bL_switcher_hotplug_callback, 0);
590
569 if (!no_bL_switcher) { 591 if (!no_bL_switcher) {
570 ret = bL_switcher_enable(); 592 ret = bL_switcher_enable();
571 if (ret) 593 if (ret)