Skip to contentSkip to conversation

sparc32,sun4d: Implemented SMP IPIs support for SUN4D machines

PATCH In review Daniel Hellstrom 1 participant 1 message May 2, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH v2 4/4 sparc32,sun4d: Implemented SMP IPIs support for SUN4D machines

The sun4d does not seem to have a distingstion between soft and hard IRQs. When generating IPIs the generated IRQ looks like a hard IRQ, this patch adds a "IPI check" in the sun4d irq trap handler at a predefined IRQ number (SUN4D_IPI_IRQ). Before generating an IPI a per-cpu memory structure is modified for the "IPI check" to successfully detect a IPI request to a specific processor, the check clears the IPI work requested.

All three IPIs (resched, single and cpu-mask) use the same IRQ number.

The IPI IRQ should preferrably be on a separate IRQ and definitly not shared with IRQ handlers requesting IRQ with IRQF_SHARED.

---
 arch/sparc/kernel/irq.h       |    6 +++
 arch/sparc/kernel/sun4d_irq.c |    9 +++++
 arch/sparc/kernel/sun4d_smp.c |   79 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 0 deletions(-)
arch/sparc/kernel/irq.h +6 -0
index a189c27..100b9c2 100644
@@ -86,4 +86,10 @@ BTFIXUPDEF_CALL(void, set_irq_udt, int)
 #define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
 #define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
 #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
+
+/* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */
+#define SUN4D_IPI_IRQ 14
+
+extern void sun4d_ipi_interrupt(void);
+
 #endif
arch/sparc/kernel/sun4d_irq.c +9 -0
index b830914..a9ea60e 100644
@@ -156,6 +156,15 @@ void sun4d_handler_irq(int pil, struct pt_regs *regs)
 
 	cc_set_iclr(1 << pil);
 
+#ifdef CONFIG_SMP
+	/*
+	 * Check IPI data structures after IRQ has been cleared. Hard and Soft
+	 * IRQ can happen at the same time, so both cases are always handled.
+	 */
+	if (pil = SUN4D_IPI_IRQ)
+		sun4d_ipi_interrupt();
+#endif
+
 	old_regs = set_irq_regs(regs);
 	irq_enter();
 	if (sbusl = 0) {
arch/sparc/kernel/sun4d_smp.c +79 -0

103 lines not on this page · raw message

Signature · 1 line
1.5.4