aboutsummaryrefslogtreecommitdiff
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-05-13 19:03:34 -0400
commitcc1b20049cd8d2f3bc2fb9d736281410b6f96fc3 (patch)
treee9a64629e90ec15dc02e33991a0f12d8fd0c1b5e
parent7ce9825b9e6fbc9654a473398d254fab0f1ecf85 (diff)
downloadvexpress-lsk-cc1b20049cd8d2f3bc2fb9d736281410b6f96fc3.tar.gz
ARM: bL_switcher: veto CPU hotplug requests when the switcher is active
Trying to support both the switcher and CPU hotplug at the same time is quickly becoming very complex for little gain. So let's simply veto any hotplug requests when the switcher is active. This restriction might be loosened a bit eventually. Signed-off-by: Nicolas Pitre <nico@linaro.org>
-rw-r--r--arch/arm/common/bL_switcher.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c
index 00a4ce23d91..fe13ce456af 100644
--- a/arch/arm/common/bL_switcher.c
+++ b/arch/arm/common/bL_switcher.c
@@ -530,6 +530,25 @@ static int __init bL_switcher_sysfs_init(void)
#endif /* CONFIG_SYSFS */
+/*
+ * Veto any CPU hotplug operation while the switcher is active.
+ * We're just not ready to deal with that given the trickery involved.
+ */
+static int bL_switcher_hotplug_callback(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
+{
+ switch (action) {
+ case CPU_UP_PREPARE:
+ case CPU_DOWN_PREPARE:
+ if (bL_switcher_active)
+ return NOTIFY_BAD;
+ }
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block bL_switcher_hotplug_notifier =
+ { &bL_switcher_hotplug_callback, NULL, 0 };
+
static bool no_bL_switcher;
core_param(no_bL_switcher, no_bL_switcher, bool, 0644);
@@ -542,6 +561,8 @@ static int __init bL_switcher_init(void)
return -EINVAL;
}
+ register_cpu_notifier(&bL_switcher_hotplug_notifier);
+
if (!no_bL_switcher) {
ret = bL_switcher_enable();
if (ret)