Skip to contentSkip to conversation

powerpc: NMI IPI make NMI IPIs fully sychronous

PATCH Superseded Nicholas Piggin 1 participant 1 message Apr 25, 2018 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc: NMI IPI make NMI IPIs fully sychronous

There is an asynchronous aspect to smp_send_nmi_ipi. The caller waits for all CPUs to call in to the handler, but it does not wait for completion of the handler. This is a needless complication, so remove it and always wait synchronously.

The synchronous wait allows the caller to easily time out and clear the wait for completion (zero nmi_ipi_busy_count) in the case of badly behaved handlers. This would have prevented the recent smp_send_stop NMI IPI bug from causing the system to hang.

---
 arch/powerpc/include/asm/smp.h |  1 -
 arch/powerpc/kernel/smp.c      | 42 +++++++++++++++++-----------------
 arch/powerpc/kernel/watchdog.c |  1 -
 3 files changed, 21 insertions(+), 23 deletions(-)
arch/powerpc/include/asm/smp.h +0 -1
index cfecfee1194b..8b844435cbd5 100644
@@ -56,7 +56,6 @@ struct smp_ops_t {
 	int   (*cpu_bootable)(unsigned int nr);
 };
 
-extern void smp_flush_nmi_ipi(u64 delay_us);
 extern int smp_send_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), u64 delay_us);
 extern void smp_send_debugger_break(void);
 extern void start_secondary_resume(void);
arch/powerpc/kernel/smp.c +21 -21

70 lines not on this page · raw message

arch/powerpc/kernel/watchdog.c +0 -1
index 6256dc3b0087..8cf048c6c1eb 100644
@@ -165,7 +165,6 @@ static void watchdog_smp_panic(int cpu, u64 tb)
 				continue;
 			smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
 		}
-		smp_flush_nmi_ipi(1000000);
 	}
 
 	/* Take the stuck CPUs out of the watch group */
Signature · 1 line
2.17.0