diff options
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 19917e89f13..7b9cddef6e5 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -60,8 +60,6 @@ extern void setup_mm_for_reboot(void); | |||
60 | 60 | ||
61 | static volatile int hlt_counter; | 61 | static volatile int hlt_counter; |
62 | 62 | ||
63 | #include <mach/system.h> | ||
64 | |||
65 | void disable_hlt(void) | 63 | void disable_hlt(void) |
66 | { | 64 | { |
67 | hlt_counter++; | 65 | hlt_counter++; |
@@ -180,13 +178,17 @@ void cpu_idle_wait(void) | |||
180 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 178 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
181 | 179 | ||
182 | /* | 180 | /* |
183 | * This is our default idle handler. We need to disable | 181 | * This is our default idle handler. |
184 | * interrupts here to ensure we don't miss a wakeup call. | ||
185 | */ | 182 | */ |
183 | |||
184 | void (*arm_pm_idle)(void); | ||
185 | |||
186 | static void default_idle(void) | 186 | static void default_idle(void) |
187 | { | 187 | { |
188 | if (!need_resched()) | 188 | if (arm_pm_idle) |
189 | arch_idle(); | 189 | arm_pm_idle(); |
190 | else | ||
191 | cpu_do_idle(); | ||
190 | local_irq_enable(); | 192 | local_irq_enable(); |
191 | } | 193 | } |
192 | 194 | ||
@@ -214,6 +216,10 @@ void cpu_idle(void) | |||
214 | cpu_die(); | 216 | cpu_die(); |
215 | #endif | 217 | #endif |
216 | 218 | ||
219 | /* | ||
220 | * We need to disable interrupts here | ||
221 | * to ensure we don't miss a wakeup call. | ||
222 | */ | ||
217 | local_irq_disable(); | 223 | local_irq_disable(); |
218 | #ifdef CONFIG_PL310_ERRATA_769419 | 224 | #ifdef CONFIG_PL310_ERRATA_769419 |
219 | wmb(); | 225 | wmb(); |
@@ -221,19 +227,18 @@ void cpu_idle(void) | |||
221 | if (hlt_counter) { | 227 | if (hlt_counter) { |
222 | local_irq_enable(); | 228 | local_irq_enable(); |
223 | cpu_relax(); | 229 | cpu_relax(); |
224 | } else { | 230 | } else if (!need_resched()) { |
225 | stop_critical_timings(); | 231 | stop_critical_timings(); |
226 | if (cpuidle_idle_call()) | 232 | if (cpuidle_idle_call()) |
227 | pm_idle(); | 233 | pm_idle(); |
228 | start_critical_timings(); | 234 | start_critical_timings(); |
229 | /* | 235 | /* |
230 | * This will eventually be removed - pm_idle | 236 | * pm_idle functions must always |
231 | * functions should always return with IRQs | 237 | * return with IRQs enabled. |
232 | * enabled. | ||
233 | */ | 238 | */ |
234 | WARN_ON(irqs_disabled()); | 239 | WARN_ON(irqs_disabled()); |
240 | } else | ||
235 | local_irq_enable(); | 241 | local_irq_enable(); |
236 | } | ||
237 | } | 242 | } |
238 | leds_event(led_idle_end); | 243 | leds_event(led_idle_end); |
239 | rcu_idle_exit(); | 244 | rcu_idle_exit(); |
@@ -532,8 +537,7 @@ int vectors_user_mapping(void) | |||
532 | struct mm_struct *mm = current->mm; | 537 | struct mm_struct *mm = current->mm; |
533 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | 538 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, |
534 | VM_READ | VM_EXEC | | 539 | VM_READ | VM_EXEC | |
535 | VM_MAYREAD | VM_MAYEXEC | | 540 | VM_MAYREAD | VM_MAYEXEC | VM_RESERVED, |
536 | VM_ALWAYSDUMP | VM_RESERVED, | ||
537 | NULL); | 541 | NULL); |
538 | } | 542 | } |
539 | 543 | ||