aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-09-11 04:29:05 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:56 -0400
commit5c0b912e755caaad555eb6feefdb1124462d8f37 (patch)
tree94911d8d9a9cb53faeb78bb2396984f64c31f2c2 /arch/s390
parente86a6ed63f46fe8fb555fda531084bca3ef62fd7 (diff)
[S390] Remove smp_cpu_not_running.
smp_cpu_not_running() and cpu_stopped() are doing the same. Remove one and also get rid of the last hard_smp_processor_id() leftover. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/smp.h32
-rw-r--r--arch/s390/kernel/smp.c34
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 */
59static inline int
60smp_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
81extern int __cpu_disable (void); 56extern int __cpu_disable (void);
82extern void __cpu_die (unsigned int cpu); 57extern 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
100extern int smp_rescan_cpus(void); 70extern 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
72static void smp_ext_bitcall(int, ec_bit_sig); 72static void smp_ext_bitcall(int, ec_bit_sig);
73 73
74static 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
74void smp_send_stop(void) 91void 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
273static 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
286static int cpu_known(int cpu_id) 290static int cpu_known(int cpu_id)
287{ 291{
288 int cpu; 292 int cpu;
@@ -636,7 +640,7 @@ int __cpu_disable(void)
636void __cpu_die(unsigned int cpu) 640void __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);