public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Neyman <stilor@att.net>
To: Chris Ball <cjb@laptop.org>,
	"open list:SECURE DIGITAL HO..." <linux-mmc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: Alexey Neyman <stilor@att.net>
Subject: [PATCH] Avoid needless loop in sdhci_irq()
Date: Tue,  5 Nov 2013 11:58:46 -0800	[thread overview]
Message-ID: <1383681526-5316-1-git-send-email-stilor@att.net> (raw)
In-Reply-To: <CAA+hA=R=hZfr6Kx_5X8PQ1ck+1wD3C6LOiXyKNMN7yrqdA0YqA@mail.gmail.com>

Ignore Card Interrupt bit in the interrupt status if we already know that
mmc_signal_sdio_irq() is going to be called at the end of sdhci_irq(). This
avoids a needless loop in sdhci_irq() repeatedly reading interrupt status
and doing nothing.

Signed-off-by: Alexey Neyman <stilor@att.net>
---
 drivers/mmc/host/sdhci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7a7fb4f..a83cd1b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2491,6 +2491,14 @@ again:
 	result = IRQ_HANDLED;
 
 	intmask = sdhci_readl(host, SDHCI_INT_STATUS);
+
+	/*
+	 * If we know we'll call the driver to signal SDIO IRQ, disregard
+	 * further indications of Card Interrupt in the status to avoid a
+	 * needless loop.
+	 */
+	if (cardint)
+		intmask &= ~SDHCI_INT_CARD_INT;
 	if (intmask && --max_loops)
 		goto again;
 out:
-- 
1.8.4.1

  reply	other threads:[~2013-11-05 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 18:43 Avoid needless loop in sdhci_irq() for Card Interrupt Alexey Neyman
2013-11-05  6:39 ` Dong Aisheng
2013-11-05 19:58   ` Alexey Neyman [this message]
2013-11-06  2:56     ` [PATCH] Avoid needless loop in sdhci_irq() Dong Aisheng
2013-11-06  3:40       ` [PATCH] mmc: sdhci: Avoid needless loop while handling SDIO interrupts " Alexey Neyman
2013-11-08 19:14         ` Chris Ball
2013-11-18 20:01         ` Alexey Neyman
2013-11-26 22:12         ` Chris Ball

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=1383681526-5316-1-git-send-email-stilor@att.net \
    --to=stilor@att.net \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@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