@@ -625,6 +625,22 @@ static void mpic_handle_msi_irq(struct pt_regs *regs, bool is_chained)
static void mpic_handle_msi_irq(struct pt_regs *r, bool b) {}
#endif
+#ifdef CONFIG_SMP
+static void mpic_handle_ipi_irq(void)
+{
+ irq_hw_number_t hwirq;
+ unsigned long cause;
+
+ cause = readl_relaxed(per_cpu_int_base + MPIC_IN_DRBEL_CAUSE);
+ cause &= IPI_DOORBELL_MASK;
+
+ for_each_set_bit(hwirq, &cause, IPI_DOORBELL_END)
+ generic_handle_domain_irq(mpic_ipi_domain, hwirq);
+}
+#else
+static inline void mpic_handle_ipi_irq(void) {}
+#endif
+
static void mpic_handle_cascade_irq(struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -677,20 +693,9 @@ static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs)
if (hwirq == 1)
mpic_handle_msi_irq(regs, false);
-#ifdef CONFIG_SMP
/* IPI Handling */
- if (hwirq == 0) {
- unsigned long ipimask;
- irq_hw_number_t ipi;
-
- ipimask = readl_relaxed(per_cpu_int_base +
- MPIC_IN_DRBEL_CAUSE) &
- IPI_DOORBELL_MASK;
-
- for_each_set_bit(ipi, &ipimask, IPI_DOORBELL_END)
- generic_handle_domain_irq(mpic_ipi_domain, ipi);
- }
-#endif
+ if (hwirq == 0)
+ mpic_handle_ipi_irq();
} while (1);
}
Refactor the handling of IPI interrupts into its own function mpic_handle_ipi_irq(), similar to mpic_handle_msi_irq(). Signed-off-by: Marek Behún <kabel@kernel.org> --- drivers/irqchip/irq-armada-370-xp.c | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-)