All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: tmio: Fix command error processing
@ 2020-11-17 13:13 Wolfram Sang
  2020-11-18 11:32 ` Niklas Söderlund
  2020-11-23 16:06 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-11-17 13:13 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Masaharu Hayakawa,
	Takeshi Saito, Wolfram Sang

From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>

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@renesas.com>
[saito: rebase to v5.4]
Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
[wsa: rebase and extension of the commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

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


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

end of thread, other threads:[~2020-11-23 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 13:13 [PATCH] mmc: tmio: Fix command error processing Wolfram Sang
2020-11-18 11:32 ` Niklas Söderlund
2020-11-23 16:06 ` Ulf Hansson

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.