aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/smp.c
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/powerpc/kernel/smp.c
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/powerpc/kernel/smp.c')
-rw-r--r--arch/powerpc/kernel/smp.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 87517ab6d36..b7441144692 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