aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-06 19:08:49 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:11 -0500
commit4912609f228da4a3d2bfbdf0f31de3d9eab2b7f8 (patch)
tree5e0a134187b877322e730421275dc87a5b797211
parentd78f8dd36b90626106ce19cb2e6828b0dc39447e (diff)
genirq: Implement handle_irq_event()
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>
-rw-r--r--kernel/irq/handle.c47
-rw-r--r--kernel/irq/internals.h3
2 files changed, 42 insertions, 8 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index cdd6fbbe771c..4ef059478ebf 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -51,14 +51,7 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action)
51 "but no thread function available.", irq, action->name); 51 "but no thread function available.", irq, action->name);
52} 52}
53 53
54/** 54static irqreturn_t __handle_irq_event(unsigned int irq, struct irqaction *action)
55 * handle_IRQ_event - irq action chain handler
56 * @irq: the interrupt number
57 * @action: the interrupt action chain for this irq
58 *
59 * Handles the action chain of an irq event
60 */
61irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
62{ 55{
63 irqreturn_t ret, retval = IRQ_NONE; 56 irqreturn_t ret, retval = IRQ_NONE;
64 unsigned int status = 0; 57 unsigned int status = 0;
@@ -120,3 +113,41 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
120 113
121 return retval; 114 return retval;
122} 115}
116
117irqreturn_t
118handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
119{
120 irqreturn_t ret = __handle_irq_event(desc->irq_data.irq, action);
121
122 if (!noirqdebug)
123 note_interrupt(desc->irq_data.irq, desc, ret);
124 return ret;
125}
126
127irqreturn_t handle_irq_event(struct irq_desc *desc)
128{
129 struct irqaction *action = desc->action;
130 irqreturn_t ret;
131
132 desc->status &= ~IRQ_PENDING;
133 desc->status |= IRQ_INPROGRESS;
134 raw_spin_unlock(&desc->lock);
135
136 ret = handle_irq_event_percpu(desc, action);
137
138 raw_spin_lock(&desc->lock);
139 desc->status &= ~IRQ_INPROGRESS;
140 return ret;
141}
142
143/**
144 * handle_IRQ_event - irq action chain handler
145 * @irq: the interrupt number
146 * @action: the interrupt action chain for this irq
147 *
148 * Handles the action chain of an irq event
149 */
150irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
151{
152 return __handle_irq_event(irq, action);
153}
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index c71fc4de0371..b61824cdadc6 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -45,6 +45,9 @@ extern void irq_disable(struct irq_desc *desc);
45 45
46extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr); 46extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
47 47
48irqreturn_t handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action);
49irqreturn_t handle_irq_event(struct irq_desc *desc);
50
48/* Resending of interrupts :*/ 51/* Resending of interrupts :*/
49void check_irq_resend(struct irq_desc *desc, unsigned int irq); 52void check_irq_resend(struct irq_desc *desc, unsigned int irq);
50bool irq_wait_for_poll(struct irq_desc *desc); 53bool irq_wait_for_poll(struct irq_desc *desc);