From: Masaharu Hayakawa <masaharu.hayakawa.ry@xxxxxxxxxxx> If some errors are detected at the same time as the access end interrupt, the access end interrupt was not cleared. Especially with DMA, because then the access end interrupt was never enabled and, thus, never cleared. Clear the interrupt register always when a command error occurs. Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@xxxxxxxxxxx> [saito: rebase to v5.4] Signed-off-by: Takeshi Saito <takeshi.saito.xv@xxxxxxxxxxx> [wsa: rebase and extension of the commit message] Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> --- Because the test case is hard to reproduce (lots of radio noise and temperature changes), I trust the BSP team here. But the reasoning makes a lot of sense to me. I verified that there are no regressions with the test cases I usually do. The patch is based on mmc/next as of today, i.e. with all previous series included. drivers/mmc/host/tmio_mmc_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index cb4149fd12e0..7f4a28125010 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -796,8 +796,10 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host) spin_unlock_irqrestore(&host->lock, flags); - if (mrq->cmd->error || (mrq->data && mrq->data->error)) + if (mrq->cmd->error || (mrq->data && mrq->data->error)) { + tmio_mmc_ack_mmc_irqs(host, TMIO_MASK_IRQ); /* Clear all */ tmio_mmc_abort_dma(host); + } /* Error means retune, but executed command was still successful */ if (host->check_retune && host->check_retune(host)) -- 2.28.0