diff options
-rw-r--r-- | arch/s390/kernel/smp.c | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index b05ae8584258..264ea906db4c 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -193,72 +193,30 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, | |||
193 | } | 193 | } |
194 | EXPORT_SYMBOL(smp_call_function_single); | 194 | EXPORT_SYMBOL(smp_call_function_single); |
195 | 195 | ||
196 | static void do_send_stop(void) | 196 | void smp_send_stop(void) |
197 | { | 197 | { |
198 | int cpu, rc; | 198 | int cpu, rc; |
199 | 199 | ||
200 | /* stop all processors */ | 200 | /* Disable all interrupts/machine checks */ |
201 | for_each_online_cpu(cpu) { | 201 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); |
202 | if (cpu == smp_processor_id()) | ||
203 | continue; | ||
204 | do { | ||
205 | rc = signal_processor(cpu, sigp_stop); | ||
206 | } while (rc == sigp_busy); | ||
207 | } | ||
208 | } | ||
209 | 202 | ||
210 | static void do_store_status(void) | 203 | /* write magic number to zero page (absolute 0) */ |
211 | { | 204 | lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC; |
212 | int cpu, rc; | ||
213 | 205 | ||
214 | /* store status of all processors in their lowcores (real 0) */ | 206 | /* stop all processors */ |
215 | for_each_online_cpu(cpu) { | 207 | for_each_online_cpu(cpu) { |
216 | if (cpu == smp_processor_id()) | 208 | if (cpu == smp_processor_id()) |
217 | continue; | 209 | continue; |
218 | do { | 210 | do { |
219 | rc = signal_processor_p( | 211 | rc = signal_processor(cpu, sigp_stop); |
220 | (__u32)(unsigned long) lowcore_ptr[cpu], cpu, | ||
221 | sigp_store_status_at_address); | ||
222 | } while (rc == sigp_busy); | 212 | } while (rc == sigp_busy); |
223 | } | ||
224 | } | ||
225 | 213 | ||
226 | static void do_wait_for_stop(void) | ||
227 | { | ||
228 | int cpu; | ||
229 | |||
230 | /* Wait for all other cpus to enter stopped state */ | ||
231 | for_each_online_cpu(cpu) { | ||
232 | if (cpu == smp_processor_id()) | ||
233 | continue; | ||
234 | while (!smp_cpu_not_running(cpu)) | 214 | while (!smp_cpu_not_running(cpu)) |
235 | cpu_relax(); | 215 | cpu_relax(); |
236 | } | 216 | } |
237 | } | 217 | } |
238 | 218 | ||
239 | /* | 219 | /* |
240 | * this function sends a 'stop' sigp to all other CPUs in the system. | ||
241 | * it goes straight through. | ||
242 | */ | ||
243 | void smp_send_stop(void) | ||
244 | { | ||
245 | /* Disable all interrupts/machine checks */ | ||
246 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); | ||
247 | |||
248 | /* write magic number to zero page (absolute 0) */ | ||
249 | lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC; | ||
250 | |||
251 | /* stop other processors. */ | ||
252 | do_send_stop(); | ||
253 | |||
254 | /* wait until other processors are stopped */ | ||
255 | do_wait_for_stop(); | ||
256 | |||
257 | /* store status of other processors. */ | ||
258 | do_store_status(); | ||
259 | } | ||
260 | |||
261 | /* | ||
262 | * Reboot, halt and power_off routines for SMP. | 220 | * Reboot, halt and power_off routines for SMP. |
263 | */ | 221 | */ |
264 | void machine_restart_smp(char *__unused) | 222 | void machine_restart_smp(char *__unused) |