summaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2012-11-13 20:32:43 +0100
committerH. Peter Anvin <hpa@linux.intel.com>2012-11-14 18:39:50 +0100
commit6e32d479db6079dd5d4309aa66aecbcf2664a5fe (patch)
tree03ba72e475b2c640dc535b873d9c10cbf76e43f5 /kernel/cpu.c
parentx86, hotplug, suspend: Online CPU0 for suspend or hibernate (diff)
downloadlinux-6e32d479db6079dd5d4309aa66aecbcf2664a5fe.tar.xz
linux-6e32d479db6079dd5d4309aa66aecbcf2664a5fe.zip
kernel/cpu.c: Add comment for priority in cpu_hotplug_pm_callback
cpu_hotplug_pm_callback should have higher priority than bsp_pm_callback which depends on cpu_hotplug_pm_callback to disable cpu hotplug to avoid race during bsp online checking. This is to hightlight the priorities between the two callbacks in case people may overlook the order. Ideally the priorities should be defined in macro/enum instead of fixed values. To do that, a seperate patchset may be pushed which will touch serveral other generic files and is out of scope of this patchset. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Link: http://lkml.kernel.org/r/1352835171-3958-7-git-send-email-fenghua.yu@intel.com Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 42bd331ee0ab..a2491a2d62bb 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -601,6 +601,11 @@ cpu_hotplug_pm_callback(struct notifier_block *nb,
static int __init cpu_hotplug_pm_sync_init(void)
{
+ /*
+ * cpu_hotplug_pm_callback has higher priority than x86
+ * bsp_pm_callback which depends on cpu_hotplug_pm_callback
+ * to disable cpu hotplug to avoid cpu hotplug race.
+ */
pm_notifier(cpu_hotplug_pm_callback, 0);
return 0;
}