diff options
Diffstat (limited to 'drivers/acpi/acpi_pad.c')
-rw-r--r-- | drivers/acpi/acpi_pad.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 62122134693b..d269a8f3329c 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 | } |
@@ -168,16 +172,14 @@ static int power_saving_thread(void *data) | |||
168 | 172 | ||
169 | do_sleep = 0; | 173 | do_sleep = 0; |
170 | 174 | ||
171 | current_thread_info()->status &= ~TS_POLLING; | ||
172 | /* | ||
173 | * TS_POLLING-cleared state must be visible before we test | ||
174 | * NEED_RESCHED: | ||
175 | */ | ||
176 | smp_mb(); | ||
177 | |||
178 | expire_time = jiffies + HZ * (100 - idle_pct) / 100; | 175 | expire_time = jiffies + HZ * (100 - idle_pct) / 100; |
179 | 176 | ||
180 | while (!need_resched()) { | 177 | while (!need_resched()) { |
178 | if (tsc_detected_unstable && !tsc_marked_unstable) { | ||
179 | /* TSC could halt in idle, so notify users */ | ||
180 | mark_tsc_unstable("TSC halts in idle"); | ||
181 | tsc_marked_unstable = 1; | ||
182 | } | ||
181 | local_irq_disable(); | 183 | local_irq_disable(); |
182 | cpu = smp_processor_id(); | 184 | cpu = smp_processor_id(); |
183 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, | 185 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, |
@@ -200,8 +202,6 @@ static int power_saving_thread(void *data) | |||
200 | } | 202 | } |
201 | } | 203 | } |
202 | 204 | ||
203 | current_thread_info()->status |= TS_POLLING; | ||
204 | |||
205 | /* | 205 | /* |
206 | * current sched_rt has threshold for rt task running time. | 206 | * current sched_rt has threshold for rt task running time. |
207 | * When a rt task uses 95% CPU time, the rt thread will be | 207 | * When a rt task uses 95% CPU time, the rt thread will be |