mmc: tmio: Fix command error processing
authorMasaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Tue, 17 Nov 2020 13:13:37 +0000 (14:13 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Nov 2020 13:22:14 +0000 (14:22 +0100)
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>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20201117131337.35307-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c

index cb4149fd12e07841c364130aea9d2a8cb6ac9da7..7f4a2812501076399d6ca381792b1e921eff8b00 100644 (file)
@@ -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))