]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
genirq: Implement handle_irq_event()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 7 Feb 2011 00:08:49 +0000 (01:08 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:11 +0000 (12:58 +0100)
Core code replacement for the ugly camel case. It contains all the
code which is shared in all handlers.

     clear status flags
     set INPROGRESS flag
     unlock
     call action chain
     note_interrupt
     lock
     clr INPROGRESS flag

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/handle.c
kernel/irq/internals.h

index cdd6fbbe771c85080a00e01b7e3443da645a0749..4ef059478ebf76e541054e6c0b0a113cb934e746 100644 (file)
@@ -51,14 +51,7 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action)
               "but no thread function available.", irq, action->name);
 }
 
-/**
- * handle_IRQ_event - irq action chain handler
- * @irq:       the interrupt number
- * @action:    the interrupt action chain for this irq
- *
- * Handles the action chain of an irq event
- */
-irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
+static irqreturn_t __handle_irq_event(unsigned int irq, struct irqaction *action)
 {
        irqreturn_t ret, retval = IRQ_NONE;
        unsigned int status = 0;
@@ -120,3 +113,41 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
 
        return retval;
 }
+
+irqreturn_t
+handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
+{
+       irqreturn_t ret = __handle_irq_event(desc->irq_data.irq, action);
+
+       if (!noirqdebug)
+               note_interrupt(desc->irq_data.irq, desc, ret);
+       return ret;
+}
+
+irqreturn_t handle_irq_event(struct irq_desc *desc)
+{
+       struct irqaction *action = desc->action;
+       irqreturn_t ret;
+
+       desc->status &= ~IRQ_PENDING;
+       desc->status |= IRQ_INPROGRESS;
+       raw_spin_unlock(&desc->lock);
+
+       ret = handle_irq_event_percpu(desc, action);
+
+       raw_spin_lock(&desc->lock);
+       desc->status &= ~IRQ_INPROGRESS;
+       return ret;
+}
+
+/**
+ * handle_IRQ_event - irq action chain handler
+ * @irq:       the interrupt number
+ * @action:    the interrupt action chain for this irq
+ *
+ * Handles the action chain of an irq event
+ */
+irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
+{
+       return __handle_irq_event(irq, action);
+}
index c71fc4de037166c4da35dcd2dd07c6c9cccd3923..b61824cdadc66720c2f2599aa97eeffdf261c7c3 100644 (file)
@@ -45,6 +45,9 @@ extern void irq_disable(struct irq_desc *desc);
 
 extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
 
+irqreturn_t handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action);
+irqreturn_t handle_irq_event(struct irq_desc *desc);
+
 /* Resending of interrupts :*/
 void check_irq_resend(struct irq_desc *desc, unsigned int irq);
 bool irq_wait_for_poll(struct irq_desc *desc);