Skip to content

Commit 6e32d47

Browse files
Fenghua YuH. Peter Anvin
authored andcommitted
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>
1 parent 209efae commit 6e32d47

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎kernel/cpu.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ cpu_hotplug_pm_callback(struct notifier_block *nb,
601601

602602
static int __init cpu_hotplug_pm_sync_init(void)
603603
{
604+
/*
605+
* cpu_hotplug_pm_callback has higher priority than x86
606+
* bsp_pm_callback which depends on cpu_hotplug_pm_callback
607+
* to disable cpu hotplug to avoid cpu hotplug race.
608+
*/
604609
pm_notifier(cpu_hotplug_pm_callback, 0);
605610
return 0;
606611
}

0 commit comments

Comments
 (0)