Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling can/will stall forever

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Remy Bohmer <linux@...>
Cc: Steven Rostedt <rostedt@...>, Thomas Gleixner <tglx@...>, Ingo Molnar <mingo@...>, ARM Linux Mailing List <linux-arm-kernel@...>, RT <linux-rt-users@...>, linux-kernel <linux-kernel@...>
Date: Wednesday, November 28, 2007 - 11:36 am

On Wed, 2007-11-28 at 15:38 +0100, Remy Bohmer wrote:

The later I think .. 


Yeah, it's clear there needs to be an unmask for this special case..
I've attached a patch which only handles the special case.. Could you
test/review it..


No .. I wouldn't comment about an company specific tree. I was talking
about the broken out real time patches.

Daniel

--------


Remove the IRQ_PENDING flag if it's asserted, and unmask the irq. Also loop
around to account for the pending interrupt.

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

---
 kernel/irq/manage.c |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

Index: linux-2.6.23/kernel/irq/manage.c
===================================================================
--- linux-2.6.23.orig/kernel/irq/manage.c
+++ linux-2.6.23/kernel/irq/manage.c
@@ -646,7 +646,7 @@ __setup("hardirq-preempt=", hardirq_pree
 /*
  * threaded simple handler
  */
-static void thread_simple_irq(irq_desc_t *desc)
+static void thread_core_irq(irq_desc_t *desc)
 {
 	struct irqaction *action = desc->action;
 	unsigned int irq = desc - irq_desc;
@@ -664,13 +664,35 @@ static void thread_simple_irq(irq_desc_t
 }
 
 /*
+ * threaded fasteoi type irq handler
+ */
+static void thread_simple_irq(irq_desc_t *desc)
+{
+	unsigned int irq = desc - irq_desc;
+
+	do {
+		/*
+		 * When another irq arrived while we were handling
+		 * one, we could have masked the irq.
+		 * Renable it, if it was not disabled in meantime.
+		 */
+		if (unlikely(desc->status & IRQ_PENDING)) {
+			desc->status &= ~IRQ_PENDING;
+			desc->chip->unmask(irq);
+		}
+		thread_core_irq(desc);
+	} while ((desc->status & (IRQ_PENDING | IRQ_INPROGRESS)));
+
+}
+
+/*
  * threaded level type irq handler
  */
 static void thread_level_irq(irq_desc_t *desc)
 {
 	unsigned int irq = desc - irq_desc;
 
-	thread_simple_irq(desc);
+	thread_core_irq(desc);
 	if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
 		desc->chip->unmask(irq);
 }
@@ -682,7 +704,7 @@ static void thread_fasteoi_irq(irq_desc_
 {
 	unsigned int irq = desc - irq_desc;
 
-	thread_simple_irq(desc);
+	thread_core_irq(desc);
 	if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
 		desc->chip->unmask(irq);
 }


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RT] Revert Softdisable for simple irqs., Steven Rostedt, (Wed Dec 12, 3:40 pm)
Re: [PATCH RT] Revert Softdisable for simple irqs., Remy Bohmer, (Wed Dec 12, 4:05 pm)
Re: [PATCH RT] Revert Softdisable for simple irqs., Steven Rostedt, (Wed Dec 12, 4:27 pm)
Re: [PATCH RT] Revert Softdisable for simple irqs., Remy Bohmer, (Wed Dec 12, 5:38 pm)
Re: [PATCH RT] Revert Softdisable for simple irqs., Russell King, (Wed Dec 12, 3:46 pm)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Wed Nov 28, 1:25 pm)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Wed Nov 28, 4:05 pm)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Thu Nov 29, 6:25 am)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Thu Nov 29, 9:36 am)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Thu Nov 29, 10:29 am)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Wed Nov 28, 7:03 pm)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Russell King - ARM Linux, (Thu Nov 29, 5:04 am)
Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling..., Daniel Walker, (Wed Nov 28, 11:36 am)