aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Cochran <rcochran@linutronix.de>2016-04-06 17:00:54 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-07 16:10:58 -0400
commit2259a819a8d37e472f08c88bc0dd22194754adb4 (patch)
tree2cb425544ec2a864e0522e7e571a7f705bb5b7c0
parentca42489d9ee3262482717c83428e087322fdc39c (diff)
intel_idle: Setup the timer broadcast only on successful driver load.
This driver sets the broadcast tick quite early on during probe and does not clean up again in cast of failure. This patch moves the setup call after the registration, placing the on_each_cpu() calls within the global CPU lock region. Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/idle/intel_idle.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 0b568728867e..ab34cd8b933c 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -987,16 +987,9 @@ static int __init intel_idle_probe(void)
987 icpu = (const struct idle_cpu *)id->driver_data; 987 icpu = (const struct idle_cpu *)id->driver_data;
988 cpuidle_state_table = icpu->state_table; 988 cpuidle_state_table = icpu->state_table;
989 989
990 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */
991 lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
992 else
993 on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
994
995 pr_debug(PREFIX "v" INTEL_IDLE_VERSION 990 pr_debug(PREFIX "v" INTEL_IDLE_VERSION
996 " model 0x%X\n", boot_cpu_data.x86_model); 991 " model 0x%X\n", boot_cpu_data.x86_model);
997 992
998 pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
999 lapic_timer_reliable_states);
1000 return 0; 993 return 0;
1001} 994}
1002 995
@@ -1234,8 +1227,16 @@ static int __init intel_idle_init(void)
1234 } 1227 }
1235 __register_cpu_notifier(&cpu_hotplug_notifier); 1228 __register_cpu_notifier(&cpu_hotplug_notifier);
1236 1229
1230 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */
1231 lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
1232 else
1233 on_each_cpu(__setup_broadcast_timer, (void *)true, 1);
1234
1237 cpu_notifier_register_done(); 1235 cpu_notifier_register_done();
1238 1236
1237 pr_debug(PREFIX "lapic_timer_reliable_states 0x%x\n",
1238 lapic_timer_reliable_states);
1239
1239 return 0; 1240 return 0;
1240} 1241}
1241 1242