diff options
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 971d65c253a9..008e7ce766a7 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -61,8 +61,6 @@ extern void setup_mm_for_reboot(void); | |||
61 | 61 | ||
62 | static volatile int hlt_counter; | 62 | static volatile int hlt_counter; |
63 | 63 | ||
64 | #include <mach/system.h> | ||
65 | |||
66 | void disable_hlt(void) | 64 | void disable_hlt(void) |
67 | { | 65 | { |
68 | hlt_counter++; | 66 | hlt_counter++; |
@@ -181,13 +179,17 @@ void cpu_idle_wait(void) | |||
181 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 179 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
182 | 180 | ||
183 | /* | 181 | /* |
184 | * This is our default idle handler. We need to disable | 182 | * This is our default idle handler. |
185 | * interrupts here to ensure we don't miss a wakeup call. | ||
186 | */ | 183 | */ |
184 | |||
185 | void (*arm_pm_idle)(void); | ||
186 | |||
187 | static void default_idle(void) | 187 | static void default_idle(void) |
188 | { | 188 | { |
189 | if (!need_resched()) | 189 | if (arm_pm_idle) |
190 | arch_idle(); | 190 | arm_pm_idle(); |
191 | else | ||
192 | cpu_do_idle(); | ||
191 | local_irq_enable(); | 193 | local_irq_enable(); |
192 | } | 194 | } |
193 | 195 | ||
@@ -215,6 +217,10 @@ void cpu_idle(void) | |||
215 | cpu_die(); | 217 | cpu_die(); |
216 | #endif | 218 | #endif |
217 | 219 | ||
220 | /* | ||
221 | * We need to disable interrupts here | ||
222 | * to ensure we don't miss a wakeup call. | ||
223 | */ | ||
218 | local_irq_disable(); | 224 | local_irq_disable(); |
219 | #ifdef CONFIG_PL310_ERRATA_769419 | 225 | #ifdef CONFIG_PL310_ERRATA_769419 |
220 | wmb(); | 226 | wmb(); |
@@ -222,19 +228,18 @@ void cpu_idle(void) | |||
222 | if (hlt_counter) { | 228 | if (hlt_counter) { |
223 | local_irq_enable(); | 229 | local_irq_enable(); |
224 | cpu_relax(); | 230 | cpu_relax(); |
225 | } else { | 231 | } else if (!need_resched()) { |
226 | stop_critical_timings(); | 232 | stop_critical_timings(); |
227 | if (cpuidle_idle_call()) | 233 | if (cpuidle_idle_call()) |
228 | pm_idle(); | 234 | pm_idle(); |
229 | start_critical_timings(); | 235 | start_critical_timings(); |
230 | /* | 236 | /* |
231 | * This will eventually be removed - pm_idle | 237 | * pm_idle functions must always |
232 | * functions should always return with IRQs | 238 | * return with IRQs enabled. |
233 | * enabled. | ||
234 | */ | 239 | */ |
235 | WARN_ON(irqs_disabled()); | 240 | WARN_ON(irqs_disabled()); |
241 | } else | ||
236 | local_irq_enable(); | 242 | local_irq_enable(); |
237 | } | ||
238 | } | 243 | } |
239 | leds_event(led_idle_end); | 244 | leds_event(led_idle_end); |
240 | rcu_idle_exit(); | 245 | rcu_idle_exit(); |