public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: grant.likely@secretlab.ca, linus.walleij@stericsson.com,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH] gpio/langwell: re-read the IRQ status register after each iteration
Date: Thu, 10 May 2012 13:01:22 +0300	[thread overview]
Message-ID: <1336644082-14137-1-git-send-email-mika.westerberg@linux.intel.com> (raw)

Spotted by Grant Likely. The IRQ status register should be re-read after
each iteration. Otherwise the loop misses the interrupt if it gets raised
immediately after handled.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
This patch applies on top of my previous patch ("gpio: langwell: convert to
use irq_domain").

 drivers/gpio/gpio-langwell.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
index b067357..a1c8754 100644
--- a/drivers/gpio/gpio-langwell.c
+++ b/drivers/gpio/gpio-langwell.c
@@ -250,11 +250,9 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
 	/* check GPIO controller to check which pin triggered the interrupt */
 	for (base = 0; base < lnw->chip.ngpio; base += 32) {
 		gedr = gpio_reg(&lnw->chip, base, GEDR);
-		pending = readl(gedr);
-		while (pending) {
+		while ((pending = readl(gedr))) {
 			gpio = __ffs(pending);
 			mask = BIT(gpio);
-			pending &= ~mask;
 			/* Clear before handling so we can't lose an edge */
 			writel(mask, gedr);
 			generic_handle_irq(irq_find_mapping(lnw->domain,
-- 
1.7.9.1


             reply	other threads:[~2012-05-10 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 10:01 Mika Westerberg [this message]
2012-05-10 12:16 ` [PATCH] gpio/langwell: re-read the IRQ status register after each iteration Linus Walleij
2012-05-10 20:34   ` Julia Lawall
2012-05-11 11:57     ` Linus Walleij
2012-05-10 22:35   ` Grant Likely

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=1336644082-14137-1-git-send-email-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    /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