Skip to content

Commit

Permalink
mmc: sdhci: Mask "spurious" interrupts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Elwell committed Sep 19, 2019
1 parent 69b7d94 commit 88b35d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,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);

Expand Down

4 comments on commit 88b35d4

@vianpl
Copy link
Contributor

@vianpl vianpl commented on 88b35d4 Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Phil,
do you have more context for this patch? We're seeing something similar upstream[1], only triggered on class 4 SD cards.

[1] https://lore.kernel.org/linux-arm-kernel/3853cd8425743b4991f5d599ec1c0fbbf4232f95.camel@suse.de/

@pelwell
Copy link
Contributor

@pelwell pelwell commented on 88b35d4 Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicolas,

I'm afraid you can infer most of it from the commit message - we discovered that under some circumstances we were getting a DATA_END interrupt when one wasn't expected. Ignoring it had no observable ill effects so it was deemed to be either spurious or delayed in some way. By trial and error I found a set of conditions that allowed me to (I believe) ignore just the spurious interrupts.

@vianpl
Copy link
Contributor

@vianpl vianpl commented on 88b35d4 Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pelwell Sorry, I forgot to CC you: https://lkml.org/lkml/2019/10/4/381

@pelwell
Copy link
Contributor

@pelwell pelwell commented on 88b35d4 Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I'll revert my patch and back-port when it gets merged.

Please sign in to comment.