linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: per.forlin@stericsson.com (Per Forlin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] sdio: add quirk to handle pending IRQ in case of none CCCR_INTx bits
Date: Wed, 1 Jun 2011 10:48:32 +0200	[thread overview]
Message-ID: <1306918113-23872-2-git-send-email-per.forlin@stericsson.com> (raw)
In-Reply-To: <1306918113-23872-1-git-send-email-per.forlin@stericsson.com>

From: Per Forlin <per.forlin@linaro.org>

Add quirk MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0 to handle SDIO device that may
have pending IRQ when none bits are set in CCCR_INTx.

This IRQ issue was identified in the libertas sdio driver where the
SDIO device seems to raise an interrupt even if there were none function
bits in CCCR_INTx set. SDIO single irq feature will call irq handler directly
in case of only one interrupt registered. It will not check the CCCR_INTx
register and miss if the register is 0 and call the irq handler anyway.
This IRQ issue is not defined by the SDIO spec.
Use this quirk to work around this SDIO IRQ issue for a specific device.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/mmc/core/sdio_irq.c |    4 ++--
 include/linux/mmc/card.h    |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 03ead02..df1e946 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -204,7 +204,8 @@ static void sdio_single_irq_set(struct mmc_card *card)
 	int i;
 
 	card->sdio_single_irq = NULL;
-	if ((card->host->caps & MMC_CAP_SDIO_IRQ) &&
+	if (!(card->quirks & MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0) &&
+	    (card->host->caps & MMC_CAP_SDIO_IRQ) &&
 	    card->host->sdio_irqs == 1)
 		for (i = 0; i < card->sdio_funcs; i++) {
 		       func = card->sdio_func[i];
@@ -301,4 +302,3 @@ int sdio_release_irq(struct sdio_func *func)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(sdio_release_irq);
-
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 7b4fd7b..852021c 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -175,6 +175,7 @@ struct mmc_card {
 #define MMC_QUIRK_DISABLE_CD	(1<<5)		/* disconnect CD/DAT[3] resistor */
 #define MMC_QUIRK_INAND_CMD38	(1<<6)		/* iNAND devices have broken CMD38 */
 #define MMC_QUIRK_BLK_NO_CMD23	(1<<7)		/* Avoid CMD23 for regular multiblock */
+#define MMC_QUIRK_SDIO_IRQ_CCCR_INTX_0 (1<<7)	/* SDIO card has IRQ even if CCCR_INTx is 0 */
 
 	unsigned int		erase_size;	/* erase size in sectors */
  	unsigned int		erase_shift;	/* if erase unit is power 2 */
-- 
1.7.4.1

  reply	other threads:[~2011-06-01  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  8:48 [PATCH v2 0/2] sdio: add quirk for spurious SDIO IRQ Per Forlin
2011-06-01  8:48 ` Per Forlin [this message]
2011-06-01  8:48   ` [PATCH v2 2/2] sdio: report error if pending IRQ but none CCCR_INTx bits Per Forlin
2011-06-01 21:36   ` [PATCH v2 1/2] sdio: add quirk to handle pending IRQ in case of " Troy Kisky
2011-06-07  6:49     ` Per Forlin
2011-06-01 15:59 ` [PATCH v2 0/2] sdio: add quirk for spurious SDIO IRQ Nicolas Pitre
2011-06-01 17:00   ` Chris Ball
2011-06-07  6:41   ` Per Forlin

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=1306918113-23872-2-git-send-email-per.forlin@stericsson.com \
    --to=per.forlin@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).