diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/smp.h | 32 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 34 |
2 files changed, 20 insertions, 46 deletions
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index 72137bc907ac..c991fe6473c9 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
@@ -51,32 +51,7 @@ extern void machine_power_off_smp(void); | |||
51 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ | 51 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ |
52 | 52 | ||
53 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) | 53 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) |
54 | 54 | #define cpu_logical_map(cpu) (cpu) | |
55 | /* | ||
56 | * returns 1 if cpu is in stopped/check stopped state or not operational | ||
57 | * returns 0 otherwise | ||
58 | */ | ||
59 | static inline int | ||
60 | smp_cpu_not_running(int cpu) | ||
61 | { | ||
62 | __u32 status; | ||
63 | |||
64 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { | ||
65 | case sigp_order_code_accepted: | ||
66 | case sigp_status_stored: | ||
67 | /* Check for stopped and check stop state */ | ||
68 | if (status & 0x50) | ||
69 | return 1; | ||
70 | break; | ||
71 | case sigp_not_operational: | ||
72 | return 1; | ||
73 | default: | ||
74 | break; | ||
75 | } | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | #define cpu_logical_map(cpu) (cpu) | ||
80 | 55 | ||
81 | extern int __cpu_disable (void); | 56 | extern int __cpu_disable (void); |
82 | extern void __cpu_die (unsigned int cpu); | 57 | extern void __cpu_die (unsigned int cpu); |
@@ -91,11 +66,6 @@ extern void arch_send_call_function_ipi(cpumask_t mask); | |||
91 | 66 | ||
92 | #endif | 67 | #endif |
93 | 68 | ||
94 | #ifndef CONFIG_SMP | ||
95 | #define hard_smp_processor_id() 0 | ||
96 | #define smp_cpu_not_running(cpu) 1 | ||
97 | #endif | ||
98 | |||
99 | #ifdef CONFIG_HOTPLUG_CPU | 69 | #ifdef CONFIG_HOTPLUG_CPU |
100 | extern int smp_rescan_cpus(void); | 70 | extern int smp_rescan_cpus(void); |
101 | #else | 71 | #else |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 9261495ca2c3..56c16876b919 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -71,6 +71,23 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); | |||
71 | 71 | ||
72 | static void smp_ext_bitcall(int, ec_bit_sig); | 72 | static void smp_ext_bitcall(int, ec_bit_sig); |
73 | 73 | ||
74 | static int cpu_stopped(int cpu) | ||
75 | { | ||
76 | __u32 status; | ||
77 | |||
78 | switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { | ||
79 | case sigp_order_code_accepted: | ||
80 | case sigp_status_stored: | ||
81 | /* Check for stopped and check stop state */ | ||
82 | if (status & 0x50) | ||
83 | return 1; | ||
84 | break; | ||
85 | default: | ||
86 | break; | ||
87 | } | ||
88 | return 0; | ||
89 | } | ||
90 | |||
74 | void smp_send_stop(void) | 91 | void smp_send_stop(void) |
75 | { | 92 | { |
76 | int cpu, rc; | 93 | int cpu, rc; |
@@ -87,7 +104,7 @@ void smp_send_stop(void) | |||
87 | rc = signal_processor(cpu, sigp_stop); | 104 | rc = signal_processor(cpu, sigp_stop); |
88 | } while (rc == sigp_busy); | 105 | } while (rc == sigp_busy); |
89 | 106 | ||
90 | while (!smp_cpu_not_running(cpu)) | 107 | while (!cpu_stopped(cpu)) |
91 | cpu_relax(); | 108 | cpu_relax(); |
92 | } | 109 | } |
93 | } | 110 | } |
@@ -270,19 +287,6 @@ static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { } | |||
270 | 287 | ||
271 | #endif /* CONFIG_ZFCPDUMP */ | 288 | #endif /* CONFIG_ZFCPDUMP */ |
272 | 289 | ||
273 | static int cpu_stopped(int cpu) | ||
274 | { | ||
275 | __u32 status; | ||
276 | |||
277 | /* Check for stopped state */ | ||
278 | if (signal_processor_ps(&status, 0, cpu, sigp_sense) == | ||
279 | sigp_status_stored) { | ||
280 | if (status & 0x40) | ||
281 | return 1; | ||
282 | } | ||
283 | return 0; | ||
284 | } | ||
285 | |||
286 | static int cpu_known(int cpu_id) | 290 | static int cpu_known(int cpu_id) |
287 | { | 291 | { |
288 | int cpu; | 292 | int cpu; |
@@ -636,7 +640,7 @@ int __cpu_disable(void) | |||
636 | void __cpu_die(unsigned int cpu) | 640 | void __cpu_die(unsigned int cpu) |
637 | { | 641 | { |
638 | /* Wait until target cpu is down */ | 642 | /* Wait until target cpu is down */ |
639 | while (!smp_cpu_not_running(cpu)) | 643 | while (!cpu_stopped(cpu)) |
640 | cpu_relax(); | 644 | cpu_relax(); |
641 | smp_free_lowcore(cpu); | 645 | smp_free_lowcore(cpu); |
642 | pr_info("Processor %d stopped\n", cpu); | 646 | pr_info("Processor %d stopped\n", cpu); |