diff options
author | Len Brown <len.brown@intel.com> | 2009-05-14 17:27:38 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-05-16 01:51:51 -0400 |
commit | 520daf7217bc1806c02eb4cfa7805447a3da2f66 (patch) | |
tree | 12e89aeaabb6dd99d0d7f49c8e7cd88d41f77c2d /drivers | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
ACPI: idle: fix init-time TSC check regression
A previous 2.6.30 patch, a71e4917dc0ebbcb5a0ecb7ca3486643c1c9a6e2,
(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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/processor_idle.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f7ca8c55956b..e39a40a2ceae 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -216,7 +216,7 @@ int acpi_processor_resume(struct acpi_device * device) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | 218 | #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) |
220 | { | 220 | { |
221 | switch (boot_cpu_data.x86_vendor) { | 221 | switch (boot_cpu_data.x86_vendor) { |
222 | case X86_VENDOR_AMD: | 222 | case X86_VENDOR_AMD: |
@@ -226,13 +226,17 @@ static int tsc_halts_in_c(int state) | |||
226 | * C/P/S0/S1 states when this bit is set. | 226 | * C/P/S0/S1 states when this bit is set. |
227 | */ | 227 | */ |
228 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | 228 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
229 | return 0; | 229 | return; |
230 | 230 | ||
231 | /*FALL THROUGH*/ | 231 | /*FALL THROUGH*/ |
232 | default: | 232 | 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"); | ||
234 | } | 236 | } |
235 | } | 237 | } |
238 | #else | ||
239 | static void tsc_check_state(int state) { return; } | ||
236 | #endif | 240 | #endif |
237 | 241 | ||
238 | static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | 242 | 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 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 585 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { |
582 | struct acpi_processor_cx *cx = &pr->power.states[i]; | 586 | struct acpi_processor_cx *cx = &pr->power.states[i]; |
583 | 587 | ||
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 | ||
589 | switch (cx->type) { | 588 | switch (cx->type) { |
590 | case ACPI_STATE_C1: | 589 | case ACPI_STATE_C1: |
591 | cx->valid = 1; | 590 | cx->valid = 1; |
@@ -603,6 +602,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
603 | acpi_timer_check_state(i, pr, cx); | 602 | acpi_timer_check_state(i, pr, cx); |
604 | break; | 603 | break; |
605 | } | 604 | } |
605 | if (cx->valid) | ||
606 | tsc_check_state(cx->type); | ||
606 | 607 | ||
607 | if (cx->valid) | 608 | if (cx->valid) |
608 | working++; | 609 | working++; |