mmc: sdhci: Mask "spurious" interrupts
authorPhil Elwell <phil@raspberrypi.org>
Fri, 28 Sep 2018 15:24:05 +0000 (16:24 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:32:55 +0000 (16:32 +0100)
Add a filter for "spurious" Transfer Complete interrupts, attempting
to make it as specific as possible:
* INT_DATA_END (transfer complete) is set
* There is a stop command in progress
* There is no data transfer in progress

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/mmc/host/sdhci.c

index 50514fe..ad123f0 100644 (file)
@@ -3104,6 +3104,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
                        result = IRQ_WAKE_THREAD;
                }
 
+               if ((intmask & SDHCI_INT_DATA_END) && !host->data &&
+                   host->cmd && (host->cmd == host->cmd->mrq->stop))
+                       intmask &= ~SDHCI_INT_DATA_END;
+
                if (intmask & SDHCI_INT_CMD_MASK)
                        sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK, &intmask);