Merge tag 'cleanup-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-omap2 / irq.c
index e022a869bff23894dd28f24274564026841e8608..6037a9a01ed529c1fd4842d5b8819ad21db10d00 100644 (file)
@@ -222,6 +222,7 @@ void __init ti81xx_init_irq(void)
 static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
 {
        u32 irqnr;
+       int handled_irq = 0;
 
        do {
                irqnr = readl_relaxed(base_addr + 0x98);
@@ -249,8 +250,15 @@ out:
                if (irqnr) {
                        irqnr = irq_find_mapping(domain, irqnr);
                        handle_IRQ(irqnr, regs);
+                       handled_irq = 1;
                }
        } while (irqnr);
+
+       /* If an irq is masked or deasserted while active, we will
+        * keep ending up here with no irq handled. So remove it from
+        * the INTC with an ack.*/
+       if (!handled_irq)
+               omap_ack_irq(NULL);
 }
 
 asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)