aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index c1d59cfdb5fb..72069ba5f1ed 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -239,7 +239,7 @@ int acpi_processor_resume(struct acpi_device * device)
239} 239}
240 240
241#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) 241#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
242static int tsc_halts_in_c(int state) 242static void tsc_check_state(int state)
243{ 243{
244 switch (boot_cpu_data.x86_vendor) { 244 switch (boot_cpu_data.x86_vendor) {
245 case X86_VENDOR_AMD: 245 case X86_VENDOR_AMD:
@@ -249,13 +249,17 @@ static int tsc_halts_in_c(int state)
249 * C/P/S0/S1 states when this bit is set. 249 * C/P/S0/S1 states when this bit is set.
250 */ 250 */
251 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) 251 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
252 return 0; 252 return;
253 253
254 /*FALL THROUGH*/ 254 /*FALL THROUGH*/
255 default: 255 default:
256 return state > ACPI_STATE_C1; 256 /* TSC could halt in idle, so notify users */
257 if (state > ACPI_STATE_C1)
258 mark_tsc_unstable("TSC halts in idle");
257 } 259 }
258} 260}
261#else
262static void tsc_check_state(int state) { return; }
259#endif 263#endif
260 264
261static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) 265static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
@@ -601,14 +605,9 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
601 605
602 pr->power.timer_broadcast_on_state = INT_MAX; 606 pr->power.timer_broadcast_on_state = INT_MAX;
603 607
604 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { 608 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
605 struct acpi_processor_cx *cx = &pr->power.states[i]; 609 struct acpi_processor_cx *cx = &pr->power.states[i];
606 610
607#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
608 /* TSC could halt in idle, so notify users */
609 if (tsc_halts_in_c(cx->type))
610 mark_tsc_unstable("TSC halts in idle");;
611#endif
612 switch (cx->type) { 611 switch (cx->type) {
613 case ACPI_STATE_C1: 612 case ACPI_STATE_C1:
614 cx->valid = 1; 613 cx->valid = 1;
@@ -626,6 +625,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
626 acpi_timer_check_state(i, pr, cx); 625 acpi_timer_check_state(i, pr, cx);
627 break; 626 break;
628 } 627 }
628 if (cx->valid)
629 tsc_check_state(cx->type);
629 630
630 if (cx->valid) 631 if (cx->valid)
631 working++; 632 working++;