public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
@ 2017-01-16 14:23 Gabriel Krisman Bertazi
  2017-01-19 10:28 ` Adrian Hunter
  2017-01-19 20:37 ` Ulf Hansson
  0 siblings, 2 replies; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-16 14:23 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson; +Cc: linux-mmc, Gabriel Krisman Bertazi

One of our kernelCI boxes hanged at boot because a faulty eSDHC device
was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
reads, which are not allowed for SD devices.  This adds a sanity check
to the interruption path, preventing that illegal command from getting
sent if the CARD_INT interruption should be disabled.

This quirk allows that particular machine to resume boot despite the
faulty hardware, instead of getting hung dealing with thousands of
mishandled interrupts.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
CC: Ulf Hansson <ulf.hansson@linaro.org>
CC: linux-mmc@vger.kernel.org
---
 drivers/mmc/host/sdhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 51cd4f0e973f..a2efa25c7f3b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2733,7 +2733,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 		if (intmask & SDHCI_INT_RETUNE)
 			mmc_retune_needed(host->mmc);
 
-		if (intmask & SDHCI_INT_CARD_INT) {
+		if ((intmask & SDHCI_INT_CARD_INT) &&
+		    (host->ier & SDHCI_INT_CARD_INT)) {
 			sdhci_enable_sdio_irq_nolock(host, false);
 			host->thread_isr |= SDHCI_INT_CARD_INT;
 			result = IRQ_WAKE_THREAD;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-31 10:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16 14:23 [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts Gabriel Krisman Bertazi
2017-01-19 10:28 ` Adrian Hunter
2017-01-19 20:37 ` Ulf Hansson
2017-01-27 19:20   ` Gabriel Krisman Bertazi
2017-01-30  8:19     ` Ulf Hansson
2017-01-30 12:34       ` Gabriel Krisman Bertazi
2017-01-30 12:40         ` Adrian Hunter
2017-01-30 13:40           ` Gabriel Krisman Bertazi
2017-01-31 10:35             ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox