public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: mingo@elte.hu
Cc: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH -rt][RESEND] fix preempt hardirqs on OMAP
Date: Sun, 10 Dec 2006 08:35:45 -0800	[thread overview]
Message-ID: <20061210163545.488430000@mvista.com> (raw)

This should fix hardirq threading when the chained handler disables an interrupt 
while setting IRQ_PENDING. Which happens on ARM OMAP. It also has the effect of 
re-running the interrupt on IRQ_PENDING, which would normally be handled inside
the chained handler. Since this happens inside a thread the chained handler will
just wake up the thread multiple times, leaving the thread to actually rerun the
interrupt.

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

---
 kernel/irq/manage.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

Index: linux-2.6.19/kernel/irq/manage.c
===================================================================
--- linux-2.6.19.orig/kernel/irq/manage.c
+++ linux-2.6.19/kernel/irq/manage.c
@@ -546,6 +546,7 @@ static void thread_simple_irq(irq_desc_t
 	unsigned int irq = desc - irq_desc;
 	irqreturn_t action_ret;
 
+restart:
 	if (action && !desc->depth) {
 		spin_unlock(&desc->lock);
 		action_ret = handle_IRQ_event(irq, action);
@@ -555,6 +556,19 @@ static void thread_simple_irq(irq_desc_t
 		if (!noirqdebug)
 			note_interrupt(irq, desc, action_ret);
 	}
+
+	/*
+	 * Some boards will disable an interrupt when it
+	 * sets IRQ_PENDING . So we have to remove the flag
+	 * and re-enable to handle it.
+	 */
+	if (desc->status & IRQ_PENDING) {
+		desc->status &= ~IRQ_PENDING;
+		if (desc->chip)
+			desc->chip->enable(irq);
+		goto restart;
+	}
+
 	desc->status &= ~IRQ_INPROGRESS;
 }
 
--

             reply	other threads:[~2006-12-10 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 16:35 Daniel Walker [this message]
2006-12-11 19:05 ` [PATCH -rt][RESEND] fix preempt hardirqs on OMAP Ingo Molnar
2006-12-11 19:38   ` Daniel Walker
2006-12-11 19:53     ` Tony Lindgren
2006-12-11 19:54     ` Russell King
2006-12-11 19:59       ` Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061210163545.488430000@mvista.com \
    --to=dwalker@mvista.com \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox