All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: Ignore unexpected CARD_INT interrupts
@ 2017-01-26  1:23 Gabriel Krisman Bertazi
  2017-01-26  9:26 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-26  1:23 UTC (permalink / raw)
  To: stable

Hi Greg,

The following patch prevents an illegal command from getting sent to SD
cards, which in turn avoids a lock-up during boot.  Can you please apply
to the 4.9 and 4.4 stable trees?

The patch was generated against the 4.9 and there will be a trivial
context conflict when applying to the 4.4.y branch.  If you prefer, I
can resend another version against that branch.

Thanks!

-- >8 --

commit 5b19196de18e1522630326c80a40a64181c78a1c upstream.

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>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 5b19196de18e1522630326c80a40a64181c78a1c)
---
 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 e1e274a0a34f..ba637ff8aa7e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2719,7 +2719,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] 3+ messages in thread

end of thread, other threads:[~2017-01-27 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26  1:23 [PATCH] mmc: sdhci: Ignore unexpected CARD_INT interrupts Gabriel Krisman Bertazi
2017-01-26  9:26 ` Greg KH
2017-01-27 17:01   ` Gabriel Krisman Bertazi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.