aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-05-10 15:29:06 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 00:30:46 -0400
commite04763713286b1e00e1c2a33fe2741caf9470f2b (patch)
tree0c02b77b7a063c7e240dd953e6c7bd9965eff020 /arch
parent2a116f3dd07cbb55b440d3841fc24a0b3fd99ccd (diff)
powerpc: Remove call sites of MSG_ALL_BUT_SELF
The only user of MSG_ALL_BUT_SELF in the whole kernel tree is powerpc, and it only uses it to start the debugger. Both debuggers always call smp_send_debugger_break with MSG_ALL_BUT_SELF, and only mpic can do anything more optimal than a loop over all online cpus, but all message passing implementations have to code for this special delivery target. Convert smp_send_debugger_break to take void and loop calling the smp_ops message_pass function for each of the other cpus in the online cpumask. Use raw_smp_processor_id() because we are either entering the debugger or trying to start kdump and the additional warning it not useful were it to trigger. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/smp.h2
-rw-r--r--arch/powerpc/kernel/kgdb.c2
-rw-r--r--arch/powerpc/kernel/smp.c19
-rw-r--r--arch/powerpc/xmon/xmon.c2
4 files changed, 16 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 50873493a97c..91472c56800f 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -35,7 +35,7 @@ extern void cpu_die(void);
35 35
36#ifdef CONFIG_SMP 36#ifdef CONFIG_SMP
37 37
38extern void smp_send_debugger_break(int cpu); 38extern void smp_send_debugger_break(void);
39extern void smp_message_recv(int); 39extern void smp_message_recv(int);
40extern void start_secondary_resume(void); 40extern void start_secondary_resume(void);
41 41
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 42850ee00ada..bd9d35f59cf4 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -109,7 +109,7 @@ static int kgdb_call_nmi_hook(struct pt_regs *regs)
109#ifdef CONFIG_SMP 109#ifdef CONFIG_SMP
110void kgdb_roundup_cpus(unsigned long flags) 110void kgdb_roundup_cpus(unsigned long flags)
111{ 111{
112 smp_send_debugger_break(MSG_ALL_BUT_SELF); 112 smp_send_debugger_break();
113} 113}
114#endif 114#endif
115 115
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 87517ab6d365..b74411446922 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -218,11 +218,18 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
218 smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION); 218 smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION);
219} 219}
220 220
221#ifdef CONFIG_DEBUGGER 221#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
222void smp_send_debugger_break(int cpu) 222void smp_send_debugger_break(void)
223{ 223{
224 if (likely(smp_ops)) 224 int cpu;
225 smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK); 225 int me = raw_smp_processor_id();
226
227 if (unlikely(!smp_ops))
228 return;
229
230 for_each_online_cpu(cpu)
231 if (cpu != me)
232 smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
226} 233}
227#endif 234#endif
228 235
@@ -230,9 +237,9 @@ void smp_send_debugger_break(int cpu)
230void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) 237void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
231{ 238{
232 crash_ipi_function_ptr = crash_ipi_callback; 239 crash_ipi_function_ptr = crash_ipi_callback;
233 if (crash_ipi_callback && smp_ops) { 240 if (crash_ipi_callback) {
234 mb(); 241 mb();
235 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK); 242 smp_send_debugger_break();
236 } 243 }
237} 244}
238#endif 245#endif
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 91309c5c00d7..42541bbcc7fa 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -437,7 +437,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
437 xmon_owner = cpu; 437 xmon_owner = cpu;
438 mb(); 438 mb();
439 if (ncpus > 1) { 439 if (ncpus > 1) {
440 smp_send_debugger_break(MSG_ALL_BUT_SELF); 440 smp_send_debugger_break();
441 /* wait for other cpus to come in */ 441 /* wait for other cpus to come in */
442 for (timeout = 100000000; timeout != 0; --timeout) { 442 for (timeout = 100000000; timeout != 0; --timeout) {
443 if (cpumask_weight(&cpus_in_xmon) >= ncpus) 443 if (cpumask_weight(&cpus_in_xmon) >= ncpus)