提交 520daf72 编写于 作者: L Len Brown

ACPI: idle: fix init-time TSC check regression

A previous 2.6.30 patch, a71e4917,
(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: NLen Brown <len.brown@intel.com>
Acked-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: NThomas Gleixner <tglx@linutronix.de>
Tested-by: NFrans Pop <elendil@planet.nl>
上级 091bf762
...@@ -216,7 +216,7 @@ int acpi_processor_resume(struct acpi_device * device) ...@@ -216,7 +216,7 @@ int acpi_processor_resume(struct acpi_device * device)
} }
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
static int tsc_halts_in_c(int state) static void tsc_check_state(int state)
{ {
switch (boot_cpu_data.x86_vendor) { switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD: case X86_VENDOR_AMD:
...@@ -226,13 +226,17 @@ static int tsc_halts_in_c(int state) ...@@ -226,13 +226,17 @@ static int tsc_halts_in_c(int state)
* C/P/S0/S1 states when this bit is set. * C/P/S0/S1 states when this bit is set.
*/ */
if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
return 0; return;
/*FALL THROUGH*/ /*FALL THROUGH*/
default: default:
return state > ACPI_STATE_C1; /* TSC could halt in idle, so notify users */
if (state > ACPI_STATE_C1)
mark_tsc_unstable("TSC halts in idle");
} }
} }
#else
static void tsc_check_state(int state) { return; }
#endif #endif
static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) 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) ...@@ -581,11 +585,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
struct acpi_processor_cx *cx = &pr->power.states[i]; struct acpi_processor_cx *cx = &pr->power.states[i];
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
/* TSC could halt in idle, so notify users */
if (tsc_halts_in_c(cx->type))
mark_tsc_unstable("TSC halts in idle");;
#endif
switch (cx->type) { switch (cx->type) {
case ACPI_STATE_C1: case ACPI_STATE_C1:
cx->valid = 1; cx->valid = 1;
...@@ -603,6 +602,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) ...@@ -603,6 +602,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
acpi_timer_check_state(i, pr, cx); acpi_timer_check_state(i, pr, cx);
break; break;
} }
if (cx->valid)
tsc_check_state(cx->type);
if (cx->valid) if (cx->valid)
working++; working++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册