diff options
| author | Venkatesh Pallipadi <venki@google.com> | 2010-05-18 17:39:16 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2010-05-28 15:34:57 -0400 |
| commit | 0dc698b93f3eecdda43b22232131324eb41e510c (patch) | |
| tree | 5eff6780615220931c8d86f9ce7f337dd4443904 | |
| parent | b6fecaa8685a9922d11db2cd79e76f43c3edc970 (diff) | |
ACPI: Don't let acpi_pad needlessly mark TSC unstable
acpi pad driver kind of aggressively marks TSC as unstable at init
time, on mwait capable and non X86_FEATURE_NONSTOP_TSC systems. This is
irrespective of whether pad driver is ever going to be used on the
system or deep C-states are supported/used. This will affect every user
who just happens to compile in (or get a kernel version which
compiles in) acpi pad driver.
Move mark_tsc_unstable() out of init to the actual idle invocation path
of the pad driver.
There is also another bug/missing_feature in the code that it does not
support 'always running apic timer' and switches to broadcast mode
unconditionally. Shaohua, can you take a look at that please.
Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Len Brown <len.brown@intel.com>
| -rw-r--r-- | drivers/acpi/acpi_pad.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 62122134693b..f169e516a1af 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
| @@ -43,6 +43,10 @@ static DEFINE_MUTEX(isolated_cpus_lock); | |||
| 43 | #define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1) | 43 | #define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1) |
| 44 | #define CPUID5_ECX_INTERRUPT_BREAK (0x2) | 44 | #define CPUID5_ECX_INTERRUPT_BREAK (0x2) |
| 45 | static unsigned long power_saving_mwait_eax; | 45 | static unsigned long power_saving_mwait_eax; |
| 46 | |||
| 47 | static unsigned char tsc_detected_unstable; | ||
| 48 | static unsigned char tsc_marked_unstable; | ||
| 49 | |||
| 46 | static void power_saving_mwait_init(void) | 50 | static void power_saving_mwait_init(void) |
| 47 | { | 51 | { |
| 48 | unsigned int eax, ebx, ecx, edx; | 52 | unsigned int eax, ebx, ecx, edx; |
| @@ -87,8 +91,8 @@ static void power_saving_mwait_init(void) | |||
| 87 | 91 | ||
| 88 | /*FALL THROUGH*/ | 92 | /*FALL THROUGH*/ |
| 89 | default: | 93 | default: |
| 90 | /* TSC could halt in idle, so notify users */ | 94 | /* TSC could halt in idle */ |
| 91 | mark_tsc_unstable("TSC halts in idle"); | 95 | tsc_detected_unstable = 1; |
| 92 | } | 96 | } |
| 93 | #endif | 97 | #endif |
| 94 | } | 98 | } |
| @@ -178,6 +182,11 @@ static int power_saving_thread(void *data) | |||
| 178 | expire_time = jiffies + HZ * (100 - idle_pct) / 100; | 182 | expire_time = jiffies + HZ * (100 - idle_pct) / 100; |
| 179 | 183 | ||
| 180 | while (!need_resched()) { | 184 | while (!need_resched()) { |
| 185 | if (tsc_detected_unstable && !tsc_marked_unstable) { | ||
| 186 | /* TSC could halt in idle, so notify users */ | ||
| 187 | mark_tsc_unstable("TSC halts in idle"); | ||
| 188 | tsc_marked_unstable = 1; | ||
| 189 | } | ||
| 181 | local_irq_disable(); | 190 | local_irq_disable(); |
| 182 | cpu = smp_processor_id(); | 191 | cpu = smp_processor_id(); |
| 183 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, | 192 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, |
