]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc/irq: Add mechanism to force a replay of interrupts
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 8 Jul 2016 06:37:07 +0000 (16:37 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 17 Jul 2016 06:42:44 +0000 (16:42 +1000)
Calling this function with interrupts soft-disabled will cause
a replay of the external interrupt vector when they are re-enabled.

This will be used by the OPAL XICS backend (and latter by the native
XIVE code) to handle EOI signaling that there are more interrupts to
fetch from the hardware since the hardware won't issue another HW
interrupt in that case.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/hw_irq.h
arch/powerpc/kernel/irq.c

index b59ac27a6b7d586495ac15b85744ed4f1bf2d301..c7d82ff62a3346eb6b807d0bbbd06a5c85a760e4 100644 (file)
@@ -130,6 +130,8 @@ static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
 
 extern bool prep_irq_for_idle(void);
 
+extern void force_external_irq_replay(void);
+
 #else /* CONFIG_PPC64 */
 
 #define SET_MSR_EE(x)  mtmsr(x)
index 58217aec30eab8fe36fcd4fc882b379cc2a972be..ac910d9982df8f70fd12fe7f9c9c5619eb4adf77 100644 (file)
@@ -342,6 +342,21 @@ bool prep_irq_for_idle(void)
        return true;
 }
 
+/*
+ * Force a replay of the external interrupt handler on this CPU.
+ */
+void force_external_irq_replay(void)
+{
+       /*
+        * This must only be called with interrupts soft-disabled,
+        * the replay will happen when re-enabling.
+        */
+       WARN_ON(!arch_irqs_disabled());
+
+       /* Indicate in the PACA that we have an interrupt to replay */
+       local_paca->irq_happened |= PACA_IRQ_EE;
+}
+
 #endif /* CONFIG_PPC64 */
 
 int arch_show_interrupts(struct seq_file *p, int prec)