Skip to content

Commit 520daf7

Browse files
committed
ACPI: idle: fix init-time TSC check regression
A previous 2.6.30 patch, a71e491, (ACPI: idle: mark_tsc_unstable() at init-time, not run-time) erroneously disabled the TSC on systems that did not actually have valid deep C-states. Move the check after the deep-C-states are validated, via new helper, tsc_check_state(), hich replaces tsc_halts_in_c(). Signed-off-by: Len Brown <len.brown@intel.com> Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Frans Pop <elendil@planet.nl>
1 parent 091bf76 commit 520daf7

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

‎drivers/acpi/processor_idle.c‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int acpi_processor_resume(struct acpi_device * device)
216216
}
217217

218218
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
219-
static int tsc_halts_in_c(int state)
219+
static void tsc_check_state(int state)
220220
{
221221
switch (boot_cpu_data.x86_vendor) {
222222
case X86_VENDOR_AMD:
@@ -226,13 +226,17 @@ static int tsc_halts_in_c(int state)
226226
* C/P/S0/S1 states when this bit is set.
227227
*/
228228
if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
229-
return 0;
229+
return;
230230

231231
/*FALL THROUGH*/
232232
default:
233-
return state > ACPI_STATE_C1;
233+
/* TSC could halt in idle, so notify users */
234+
if (state > ACPI_STATE_C1)
235+
mark_tsc_unstable("TSC halts in idle");
234236
}
235237
}
238+
#else
239+
static void tsc_check_state(int state) { return; }
236240
#endif
237241

238242
static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
@@ -581,11 +585,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
581585
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
582586
struct acpi_processor_cx *cx = &pr->power.states[i];
583587

584-
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
585-
/* TSC could halt in idle, so notify users */
586-
if (tsc_halts_in_c(cx->type))
587-
mark_tsc_unstable("TSC halts in idle");;
588-
#endif
589588
switch (cx->type) {
590589
case ACPI_STATE_C1:
591590
cx->valid = 1;
@@ -603,6 +602,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
603602
acpi_timer_check_state(i, pr, cx);
604603
break;
605604
}
605+
if (cx->valid)
606+
tsc_check_state(cx->type);
606607

607608
if (cx->valid)
608609
working++;

0 commit comments

Comments
 (0)