aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/idle/intel_idle.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2012-01-10 18:48:19 -0500
committerLen Brown <len.brown@intel.com>2012-01-17 05:15:36 -0500
commit39a74fdedd1c1461d6fb6d330b5266886513c98f (patch)
treef5b2e18a41684dfa8df7aa24015576236f1f7d8d /drivers/idle/intel_idle.c
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
intel_idle: fix API misuse
smp_call_function() only lets all other CPUs execute a specific function, while we expect all CPUs do in intel_idle. Without the fix, we could have one cpu which has auto_demotion enabled or has no broadcast timer setup. Usually we don't see impact because auto demotion just harms power and the intel_idle init is called in CPU 0, where boradcast timer delivers interrupt, but this still could be a problem. Cc: stable@vger.kernel.org Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r--drivers/idle/intel_idle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 5d2f8e13cf0..af0b4a5d52f 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -394,7 +394,7 @@ static int intel_idle_probe(void)
394 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */ 394 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */
395 lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE; 395 lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
396 else { 396 else {
397 smp_call_function(__setup_broadcast_timer, (void *)true, 1); 397 on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
398 register_cpu_notifier(&setup_broadcast_notifier); 398 register_cpu_notifier(&setup_broadcast_notifier);
399 } 399 }
400 400
@@ -471,7 +471,7 @@ static int intel_idle_cpuidle_driver_init(void)
471 } 471 }
472 472
473 if (auto_demotion_disable_flags) 473 if (auto_demotion_disable_flags)
474 smp_call_function(auto_demotion_disable, NULL, 1); 474 on_each_cpu(auto_demotion_disable, NULL, 1);
475 475
476 return 0; 476 return 0;
477} 477}
@@ -568,7 +568,7 @@ static void __exit intel_idle_exit(void)
568 cpuidle_unregister_driver(&intel_idle_driver); 568 cpuidle_unregister_driver(&intel_idle_driver);
569 569
570 if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE) { 570 if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE) {
571 smp_call_function(__setup_broadcast_timer, (void *)false, 1); 571 on_each_cpu(__setup_broadcast_timer, (void *)false, 1);
572 unregister_cpu_notifier(&setup_broadcast_notifier); 572 unregister_cpu_notifier(&setup_broadcast_notifier);
573 } 573 }
574 574