All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error
@ 2019-05-15 18:23 Wolfram Sang
  2019-05-16 11:22 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wolfram Sang @ 2019-05-15 18:23 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Niklas Söderlund, Yoshihiro Shimoda,
	Takeshi Saito, Wolfram Sang

From: Takeshi Saito <takeshi.saito.xv@renesas.com>

If an SCC error occurs during a read/write command execution, a false
positive CRC error message is output.

mmcblk0: response CRC error sending r/w cmd command, card status 0x900

check_scc_error() checks SCC_RVSREQ.RVSERR bit. RVSERR detects a
correction error in the next (up or down) delay tap position. However,
since the command is successful, only retuning needs to be executed.
This has been confirmed by HW engineers.

Thus, on SCC error, set retuning flag instead of setting an error code.

Fixes: b85fb0a1c8ae ("mmc: tmio: Fix SCC error detection")
Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
[wsa: updated comment and commit message, removed some braces]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This patch was suggested by the BSP team because they were seeing CRC errors
with a hardware I don't have access to. I tested this with my R-Car H3-ES2.0
and M3-N (both Salvator-XS), and things were still running fine. But I suggest
to wait for a final ack from Shimoda-san or someone from the BSP team.


 drivers/mmc/host/tmio_mmc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 595949f1f001..78cc2a928efe 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -842,8 +842,9 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
 	if (mrq->cmd->error || (mrq->data && mrq->data->error))
 		tmio_mmc_abort_dma(host);
 
+	/* SCC error means retune, but executed command was still successful */
 	if (host->check_scc_error && host->check_scc_error(host))
-		mrq->cmd->error = -EILSEQ;
+		mmc_retune_needed(host->mmc);
 
 	/* If SET_BLOCK_COUNT, continue with main command */
 	if (host->mrq && !mrq->cmd->error) {
-- 
2.11.0


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

* Re: [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error
  2019-05-15 18:23 [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error Wolfram Sang
@ 2019-05-16 11:22 ` Simon Horman
  2019-05-21  7:11 ` Yoshihiro Shimoda
  2019-05-28  8:52 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2019-05-16 11:22 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, linux-renesas-soc, Niklas Söderlund,
	Yoshihiro Shimoda, Takeshi Saito

On Wed, May 15, 2019 at 08:23:46PM +0200, Wolfram Sang wrote:
> From: Takeshi Saito <takeshi.saito.xv@renesas.com>
> 
> If an SCC error occurs during a read/write command execution, a false
> positive CRC error message is output.
> 
> mmcblk0: response CRC error sending r/w cmd command, card status 0x900
> 
> check_scc_error() checks SCC_RVSREQ.RVSERR bit. RVSERR detects a
> correction error in the next (up or down) delay tap position. However,
> since the command is successful, only retuning needs to be executed.
> This has been confirmed by HW engineers.
> 
> Thus, on SCC error, set retuning flag instead of setting an error code.
> 
> Fixes: b85fb0a1c8ae ("mmc: tmio: Fix SCC error detection")
> Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> [wsa: updated comment and commit message, removed some braces]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* RE: [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error
  2019-05-15 18:23 [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error Wolfram Sang
  2019-05-16 11:22 ` Simon Horman
@ 2019-05-21  7:11 ` Yoshihiro Shimoda
  2019-05-28  8:52 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-21  7:11 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc
  Cc: linux-renesas-soc, Niklas Söderlund, Takeshi Saito

Hi Wolfram-san,

> From: Wolfram Sang, Sent: Thursday, May 16, 2019 3:24 AM
> 
> From: Takeshi Saito <takeshi.saito.xv@renesas.com>
> 
> If an SCC error occurs during a read/write command execution, a false
> positive CRC error message is output.
> 
> mmcblk0: response CRC error sending r/w cmd command, card status 0x900
> 
> check_scc_error() checks SCC_RVSREQ.RVSERR bit. RVSERR detects a
> correction error in the next (up or down) delay tap position. However,
> since the command is successful, only retuning needs to be executed.
> This has been confirmed by HW engineers.
> 
> Thus, on SCC error, set retuning flag instead of setting an error code.
> 
> Fixes: b85fb0a1c8ae ("mmc: tmio: Fix SCC error detection")
> Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> [wsa: updated comment and commit message, removed some braces]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> This patch was suggested by the BSP team because they were seeing CRC errors
> with a hardware I don't have access to. I tested this with my R-Car H3-ES2.0
> and M3-N (both Salvator-XS), and things were still running fine. But I suggest
> to wait for a final ack from Shimoda-san or someone from the BSP team.

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error
  2019-05-15 18:23 [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error Wolfram Sang
  2019-05-16 11:22 ` Simon Horman
  2019-05-21  7:11 ` Yoshihiro Shimoda
@ 2019-05-28  8:52 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2019-05-28  8:52 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, Linux-Renesas, Niklas Söderlund,
	Yoshihiro Shimoda, Takeshi Saito

On Wed, 15 May 2019 at 20:24, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> From: Takeshi Saito <takeshi.saito.xv@renesas.com>
>
> If an SCC error occurs during a read/write command execution, a false
> positive CRC error message is output.
>
> mmcblk0: response CRC error sending r/w cmd command, card status 0x900
>
> check_scc_error() checks SCC_RVSREQ.RVSERR bit. RVSERR detects a
> correction error in the next (up or down) delay tap position. However,
> since the command is successful, only retuning needs to be executed.
> This has been confirmed by HW engineers.
>
> Thus, on SCC error, set retuning flag instead of setting an error code.
>
> Fixes: b85fb0a1c8ae ("mmc: tmio: Fix SCC error detection")
> Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> [wsa: updated comment and commit message, removed some braces]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
>
> This patch was suggested by the BSP team because they were seeing CRC errors
> with a hardware I don't have access to. I tested this with my R-Car H3-ES2.0
> and M3-N (both Salvator-XS), and things were still running fine. But I suggest
> to wait for a final ack from Shimoda-san or someone from the BSP team.
>
>
>  drivers/mmc/host/tmio_mmc_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
> index 595949f1f001..78cc2a928efe 100644
> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -842,8 +842,9 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
>         if (mrq->cmd->error || (mrq->data && mrq->data->error))
>                 tmio_mmc_abort_dma(host);
>
> +       /* SCC error means retune, but executed command was still successful */
>         if (host->check_scc_error && host->check_scc_error(host))
> -               mrq->cmd->error = -EILSEQ;
> +               mmc_retune_needed(host->mmc);
>
>         /* If SET_BLOCK_COUNT, continue with main command */
>         if (host->mrq && !mrq->cmd->error) {
> --
> 2.11.0
>

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

end of thread, other threads:[~2019-05-28  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 18:23 [PATCH] mmc: tmio: fix SCC error handling to avoid false positive CRC error Wolfram Sang
2019-05-16 11:22 ` Simon Horman
2019-05-21  7:11 ` Yoshihiro Shimoda
2019-05-28  8:52 ` 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.