diff options
Diffstat (limited to 'arch/s390/kernel/process.c')
| -rw-r--r-- | arch/s390/kernel/process.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 9f3dff6c0b72..78b64fe5e7c2 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
| @@ -99,15 +99,15 @@ void default_idle(void) | |||
| 99 | { | 99 | { |
| 100 | int cpu, rc; | 100 | int cpu, rc; |
| 101 | 101 | ||
| 102 | /* CPU is going idle. */ | ||
| 103 | cpu = smp_processor_id(); | ||
| 104 | |||
| 102 | local_irq_disable(); | 105 | local_irq_disable(); |
| 103 | if (need_resched()) { | 106 | if (need_resched()) { |
| 104 | local_irq_enable(); | 107 | local_irq_enable(); |
| 105 | schedule(); | 108 | return; |
| 106 | return; | 109 | } |
| 107 | } | ||
| 108 | 110 | ||
| 109 | /* CPU is going idle. */ | ||
| 110 | cpu = smp_processor_id(); | ||
| 111 | rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu); | 111 | rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu); |
| 112 | if (rc != NOTIFY_OK && rc != NOTIFY_DONE) | 112 | if (rc != NOTIFY_OK && rc != NOTIFY_DONE) |
| 113 | BUG(); | 113 | BUG(); |
| @@ -120,7 +120,7 @@ void default_idle(void) | |||
| 120 | __ctl_set_bit(8, 15); | 120 | __ctl_set_bit(8, 15); |
| 121 | 121 | ||
| 122 | #ifdef CONFIG_HOTPLUG_CPU | 122 | #ifdef CONFIG_HOTPLUG_CPU |
| 123 | if (cpu_is_offline(smp_processor_id())) | 123 | if (cpu_is_offline(cpu)) |
| 124 | cpu_die(); | 124 | cpu_die(); |
| 125 | #endif | 125 | #endif |
| 126 | 126 | ||
| @@ -139,8 +139,14 @@ void default_idle(void) | |||
| 139 | 139 | ||
| 140 | void cpu_idle(void) | 140 | void cpu_idle(void) |
| 141 | { | 141 | { |
| 142 | for (;;) | 142 | for (;;) { |
| 143 | default_idle(); | 143 | while (!need_resched()) |
| 144 | default_idle(); | ||
| 145 | |||
| 146 | preempt_enable_no_resched(); | ||
| 147 | schedule(); | ||
| 148 | preempt_disable(); | ||
| 149 | } | ||
| 144 | } | 150 | } |
| 145 | 151 | ||
| 146 | void show_regs(struct pt_regs *regs) | 152 | void show_regs(struct pt_regs *regs) |
