public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Colin Cross <ccross@android.com>
To: linux-kernel@vger.kernel.org
Cc: Colin Cross <ccross@android.com>, Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] irq: Always clear pending flag in check_irq_resend
Date: Sun, 12 Jun 2011 17:47:20 -0700	[thread overview]
Message-ID: <1307926040-29020-1-git-send-email-ccross@android.com> (raw)

If an interrupt occurs while the irq is masked, the irq is marked
as pending.  For a level triggered interrupt, the pending flag
is only cleared when the interrupt is handled.  If the interrupt
is never handled because the irq is deasserted before being
enabled it will stay pending, and suspend may be blocked by
check_wakeup_irqs.

Change check_irq_resend to always clear the pending flag,
including for level interrupts.

Signed-off-by: Colin Cross <ccross@android.com>
---
 kernel/irq/resend.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index 14dd576..ef60772 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -55,17 +55,18 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);
  */
 void check_irq_resend(struct irq_desc *desc, unsigned int irq)
 {
-	/*
-	 * We do not resend level type interrupts. Level type
-	 * interrupts are resent by hardware when they are still
-	 * active.
-	 */
-	if (irq_settings_is_level(desc))
-		return;
-	if (desc->istate & IRQS_REPLAY)
-		return;
 	if (desc->istate & IRQS_PENDING) {
 		desc->istate &= ~IRQS_PENDING;
+		/*
+		 * We do not resend level type interrupts. Level type
+		 * interrupts are resent by hardware when they are still
+		 * active.
+		 */
+		if (irq_settings_is_level(desc))
+			return;
+		if (desc->istate & IRQS_REPLAY)
+			return;
+
 		desc->istate |= IRQS_REPLAY;
 
 		if (!desc->irq_data.chip->irq_retrigger ||
-- 
1.7.4.1


                 reply	other threads:[~2011-06-13  0:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1307926040-29020-1-git-send-email-ccross@android.com \
    --to=ccross@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --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