diff options
Diffstat (limited to 'arch/ia64/kernel/process.c')
| -rw-r--r-- | arch/ia64/kernel/process.c | 34 | 
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 051e050359e4..640d6908f8ec 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c  | |||
| @@ -197,11 +197,15 @@ void | |||
| 197 | default_idle (void) | 197 | default_idle (void) | 
| 198 | { | 198 | { | 
| 199 | local_irq_enable(); | 199 | local_irq_enable(); | 
| 200 | while (!need_resched()) | 200 | while (!need_resched()) { | 
| 201 | if (can_do_pal_halt) | 201 | if (can_do_pal_halt) { | 
| 202 | safe_halt(); | 202 | local_irq_disable(); | 
| 203 | else | 203 | if (!need_resched()) | 
| 204 | safe_halt(); | ||
| 205 | local_irq_enable(); | ||
| 206 | } else | ||
| 204 | cpu_relax(); | 207 | cpu_relax(); | 
| 208 | } | ||
| 205 | } | 209 | } | 
| 206 | 210 | ||
| 207 | #ifdef CONFIG_HOTPLUG_CPU | 211 | #ifdef CONFIG_HOTPLUG_CPU | 
| @@ -263,16 +267,16 @@ void __attribute__((noreturn)) | |||
| 263 | cpu_idle (void) | 267 | cpu_idle (void) | 
| 264 | { | 268 | { | 
| 265 | void (*mark_idle)(int) = ia64_mark_idle; | 269 | void (*mark_idle)(int) = ia64_mark_idle; | 
| 270 | int cpu = smp_processor_id(); | ||
| 271 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
| 266 | 272 | ||
| 267 | /* endless idle loop with no priority at all */ | 273 | /* endless idle loop with no priority at all */ | 
| 268 | while (1) { | 274 | while (1) { | 
| 275 | if (!need_resched()) { | ||
| 276 | void (*idle)(void); | ||
| 269 | #ifdef CONFIG_SMP | 277 | #ifdef CONFIG_SMP | 
| 270 | if (!need_resched()) | ||
| 271 | min_xtp(); | 278 | min_xtp(); | 
| 272 | #endif | 279 | #endif | 
| 273 | while (!need_resched()) { | ||
| 274 | void (*idle)(void); | ||
| 275 | |||
| 276 | if (__get_cpu_var(cpu_idle_state)) | 280 | if (__get_cpu_var(cpu_idle_state)) | 
| 277 | __get_cpu_var(cpu_idle_state) = 0; | 281 | __get_cpu_var(cpu_idle_state) = 0; | 
| 278 | 282 | ||
| @@ -284,17 +288,17 @@ cpu_idle (void) | |||
| 284 | if (!idle) | 288 | if (!idle) | 
| 285 | idle = default_idle; | 289 | idle = default_idle; | 
| 286 | (*idle)(); | 290 | (*idle)(); | 
| 287 | } | 291 | if (mark_idle) | 
| 288 | 292 | (*mark_idle)(0); | |
| 289 | if (mark_idle) | ||
| 290 | (*mark_idle)(0); | ||
| 291 | |||
| 292 | #ifdef CONFIG_SMP | 293 | #ifdef CONFIG_SMP | 
| 293 | normal_xtp(); | 294 | normal_xtp(); | 
| 294 | #endif | 295 | #endif | 
| 296 | } | ||
| 297 | preempt_enable_no_resched(); | ||
| 295 | schedule(); | 298 | schedule(); | 
| 299 | preempt_disable(); | ||
| 296 | check_pgt_cache(); | 300 | check_pgt_cache(); | 
| 297 | if (cpu_is_offline(smp_processor_id())) | 301 | if (cpu_is_offline(cpu)) | 
| 298 | play_dead(); | 302 | play_dead(); | 
| 299 | } | 303 | } | 
| 300 | } | 304 | } | 
