aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/kernel/idle.c')
-rw-r--r--arch/ppc/kernel/idle.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
index 11e5b44713f7..821a75e45602 100644
--- a/arch/ppc/kernel/idle.c
+++ b/arch/ppc/kernel/idle.c
@@ -53,10 +53,6 @@ void default_idle(void)
53 } 53 }
54#endif 54#endif
55 } 55 }
56 if (need_resched())
57 schedule();
58 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
59 cpu_die();
60} 56}
61 57
62/* 58/*
@@ -64,11 +60,22 @@ void default_idle(void)
64 */ 60 */
65void cpu_idle(void) 61void cpu_idle(void)
66{ 62{
67 for (;;) 63 int cpu = smp_processor_id();
68 if (ppc_md.idle != NULL) 64
69 ppc_md.idle(); 65 for (;;) {
70 else 66 while (!need_resched()) {
71 default_idle(); 67 if (ppc_md.idle != NULL)
68 ppc_md.idle();
69 else
70 default_idle();
71 }
72
73 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
74 cpu_die();
75 preempt_enable_no_resched();
76 schedule();
77 preempt_disable();
78 }
72} 79}
73 80
74#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx) 81#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)