]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq; Add fasteoi irq_chip quirk
authorThomas Gleixner <tglx@linutronix.de>
Tue, 15 Feb 2011 09:33:57 +0000 (10:33 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:24 +0000 (12:58 +0100)
Some chips want irq_eoi() only called when an interrupt is actually
handled. So they have checks for INPROGRESS and DISABLED in their
irq_eoi callbacks. Add a chip flag, which allows to handle that in the
generic code. No impact on the fastpath.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/irq.h
kernel/irq/chip.c

index 36390970693c193c875a1ad83ab91fc999c1d3e2..ea2970c294aaf3a84702213b9bb2e08ee9e08334 100644 (file)
@@ -328,10 +328,12 @@ struct irq_chip {
 /*
  * irq_chip specific flags
  *
- * IRQCHIP_SET_TYPE_MASKED:            Mask before calling chip.irq_set_type()
+ * IRQCHIP_SET_TYPE_MASKED:    Mask before calling chip.irq_set_type()
+ * IRQCHIP_EOI_IF_HANDLED:     Only issue irq_eoi() when irq was handled
  */
 enum {
        IRQCHIP_SET_TYPE_MASKED         = (1 <<  0),
+       IRQCHIP_EOI_IF_HANDLED          = (1 <<  1),
 };
 
 /* This include will go away once we isolated irq_desc usage to core code */
index 08be5d182be34fb32cdba4d66a6207db101da684..1d3e25e68b0c91fe972ac02ed2e5946636b87e6a 100644 (file)
@@ -515,9 +515,16 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
        }
        preflow_handler(desc);
        handle_irq_event(desc);
-out:
+
+out_eoi:
        desc->irq_data.chip->irq_eoi(&desc->irq_data);
+out_unlock:
        raw_spin_unlock(&desc->lock);
+       return;
+out:
+       if (!(desc->irq_data.chip->flags & IRQCHIP_EOI_IF_HANDLED))
+               goto out_eoi;
+       goto out_unlock;
 }
 
 /**