diff options
Diffstat (limited to 'arch/ppc/kernel/idle.c')
-rw-r--r-- | arch/ppc/kernel/idle.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c index 53547b6de45b..fba29c876b62 100644 --- a/arch/ppc/kernel/idle.c +++ b/arch/ppc/kernel/idle.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/ptrace.h> | 22 | #include <linux/ptrace.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/sysctl.h> | 24 | #include <linux/sysctl.h> |
25 | #include <linux/cpu.h> | ||
25 | 26 | ||
26 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
@@ -35,6 +36,7 @@ | |||
35 | void default_idle(void) | 36 | void default_idle(void) |
36 | { | 37 | { |
37 | void (*powersave)(void); | 38 | void (*powersave)(void); |
39 | int cpu = smp_processor_id(); | ||
38 | 40 | ||
39 | powersave = ppc_md.power_save; | 41 | powersave = ppc_md.power_save; |
40 | 42 | ||
@@ -44,7 +46,7 @@ void default_idle(void) | |||
44 | #ifdef CONFIG_SMP | 46 | #ifdef CONFIG_SMP |
45 | else { | 47 | else { |
46 | set_thread_flag(TIF_POLLING_NRFLAG); | 48 | set_thread_flag(TIF_POLLING_NRFLAG); |
47 | while (!need_resched()) | 49 | while (!need_resched() && !cpu_is_offline(cpu)) |
48 | barrier(); | 50 | barrier(); |
49 | clear_thread_flag(TIF_POLLING_NRFLAG); | 51 | clear_thread_flag(TIF_POLLING_NRFLAG); |
50 | } | 52 | } |
@@ -52,6 +54,8 @@ void default_idle(void) | |||
52 | } | 54 | } |
53 | if (need_resched()) | 55 | if (need_resched()) |
54 | schedule(); | 56 | schedule(); |
57 | if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) | ||
58 | cpu_die(); | ||
55 | } | 59 | } |
56 | 60 | ||
57 | /* | 61 | /* |