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

* Re: [PATCH] mmc: tmio: Fix command error processing
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-11-18 11:32 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, linux-renesas-soc, Yoshihiro Shimoda,
	Masaharu Hayakawa, Takeshi Saito

Hi Wolfram,

Thanks for your work.

On 2020-11-17 14:13:37 +0100, Wolfram Sang wrote:
> 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.

I agree the reasoning make sens and the patch looks good,

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 
>  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
> 

-- 
Regards,
Niklas Söderlund

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

* Re: [PATCH] mmc: tmio: Fix command error processing
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-11-23 16:06 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, Linux-Renesas, Yoshihiro Shimoda, Masaharu Hayakawa,
	Takeshi Saito

On Tue, 17 Nov 2020 at 14:15, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> 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>

Applied for next, thanks!

Kind regards
Uffe


> ---
>
> 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	[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.