diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-02-19 09:29:26 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-02-19 09:29:33 -0500 |
commit | 11ab244c9faead91683a12e4cb10d26b279bb4aa (patch) | |
tree | 73f5498f5de7a81e1337aa1349f2d5db8a115376 /arch/s390/kernel | |
parent | 057c5cb35ece6ae3a4c2cb849f3948c5ad6add32 (diff) |
[S390] Make sure enabled wait psw is loaded in default_idle.
If both NO_IDLE_HZ and VIRT_TIMER are disabled default_idle won't load
an enabled wait psw and busy loop instead. This is because the
idle_chain is empty and the return value of atomic_notifier_call_chain
will be NOTIFY_DONE, which causes default_idle to return instead of
loading an enabled wait psw.
Fix this by calling __atomic_notifier_call_chain instead and add proper
return value handling.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/process.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index a6a4729e0e94..1c59ec161cf8 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -114,24 +114,27 @@ extern void s390_handle_mcck(void); | |||
114 | static void default_idle(void) | 114 | static void default_idle(void) |
115 | { | 115 | { |
116 | int cpu, rc; | 116 | int cpu, rc; |
117 | int nr_calls = 0; | ||
118 | void *hcpu; | ||
117 | #ifdef CONFIG_SMP | 119 | #ifdef CONFIG_SMP |
118 | struct s390_idle_data *idle; | 120 | struct s390_idle_data *idle; |
119 | #endif | 121 | #endif |
120 | 122 | ||
121 | /* CPU is going idle. */ | 123 | /* CPU is going idle. */ |
122 | cpu = smp_processor_id(); | 124 | cpu = smp_processor_id(); |
123 | 125 | hcpu = (void *)(long)cpu; | |
124 | local_irq_disable(); | 126 | local_irq_disable(); |
125 | if (need_resched()) { | 127 | if (need_resched()) { |
126 | local_irq_enable(); | 128 | local_irq_enable(); |
127 | return; | 129 | return; |
128 | } | 130 | } |
129 | 131 | ||
130 | rc = atomic_notifier_call_chain(&idle_chain, | 132 | rc = __atomic_notifier_call_chain(&idle_chain, S390_CPU_IDLE, hcpu, -1, |
131 | S390_CPU_IDLE, (void *)(long) cpu); | 133 | &nr_calls); |
132 | if (rc != NOTIFY_OK && rc != NOTIFY_DONE) | 134 | if (rc == NOTIFY_BAD) { |
133 | BUG(); | 135 | nr_calls--; |
134 | if (rc != NOTIFY_OK) { | 136 | __atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE, |
137 | hcpu, nr_calls, NULL); | ||
135 | local_irq_enable(); | 138 | local_irq_enable(); |
136 | return; | 139 | return; |
137 | } | 140 | } |