mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC][PATCH] irq: support IRQ_NESTED_THREAD with non-threaded interrupt handlers
@ 2010-06-04 21:19 Esben Haabendal
  2010-06-04 21:46 ` Thomas Gleixner
  0 siblings, 1 reply; 21+ messages in thread
From: Esben Haabendal @ 2010-06-04 21:19 UTC (permalink / raw)
  To: linux-kernel, maz, tglx, mingo, joachim.eastwood

set_irq_nested_thread() might be called by interrupt controller to
supported nested irq thread handling, and with this change, drivers
with non-threaded irq handlers can still use the irqs.

Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
 kernel/irq/chip.c   |    9 ++++++++-
 kernel/irq/manage.c |    4 +---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index b7091d5..8202993 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -405,7 +405,14 @@ void handle_nested_irq(unsigned int irq)
 	desc->status |= IRQ_INPROGRESS;
 	raw_spin_unlock_irq(&desc->lock);
 
-	action_ret = action->thread_fn(action->irq, action->dev_id);
+	if (desc->status & IRQ_NESTED_THREAD && action->thread_fn)
+		action_ret = action->thread_fn(action->irq, action->dev_id);
+	else {
+		local_irq_disable();
+		action_ret = action->handler(action->irq, action->dev_id);
+		local_irq_enable();
+	}
+
 	if (!noirqdebug)
 		note_interrupt(irq, desc, action_ret);
 
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 3164ba7..e7bca04 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -681,10 +681,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 	 * Check whether the interrupt nests into another interrupt
 	 * thread.
 	 */
-	nested = desc->status & IRQ_NESTED_THREAD;
+	nested = (desc->status & IRQ_NESTED_THREAD) && new->thread_fn;
 	if (nested) {
-		if (!new->thread_fn)
-			return -EINVAL;
 		/*
 		 * Replace the primary handler which was provided from
 		 * the driver for non nested interrupt handling by the
-- 
1.7.1




^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-06-08 14:15 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-04 21:19 [RFC][PATCH] irq: support IRQ_NESTED_THREAD with non-threaded interrupt handlers Esben Haabendal
2010-06-04 21:46 ` Thomas Gleixner
2010-06-05 13:56   ` Esben Haabendal
2010-06-05 14:10     ` Marc Zyngier
2010-06-05 15:33       ` Thomas Gleixner
2010-06-05 17:01         ` Esben Haabendal
2010-06-05 18:52           ` Thomas Gleixner
2010-06-05 19:48             ` Esben Haabendal
2010-06-05 20:14               ` Thomas Gleixner
2010-06-06 19:50                 ` Esben Haabendal
2010-06-06 22:08                   ` Thomas Gleixner
2010-06-07 12:34                     ` Esben Haabendal
2010-06-07 15:06                       ` Thomas Gleixner
2010-06-07 21:28                         ` Esben Haabendal
2010-06-07 23:18                           ` Thomas Gleixner
2010-06-08 14:15                             ` Esben Haabendal
2010-06-08  6:58                           ` Thomas Gleixner
2010-06-08  7:23                             ` Esben Haabendal
2010-06-05 16:53       ` Esben Haabendal
2010-06-05 17:18         ` Marc Zyngier
2010-06-05 19:38           ` Esben Haabendal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®