]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.1.9/mmc-tmio-fix-scc-error-handling-to-avoid-false-positive-crc-error.patch
Linux 5.1.9
[thirdparty/kernel/stable-queue.git] / releases / 5.1.9 / mmc-tmio-fix-scc-error-handling-to-avoid-false-positive-crc-error.patch
CommitLineData
7a7567a2
GKH
1From 51b72656bb39fdcb8f3174f4007bcc83ad1d275f Mon Sep 17 00:00:00 2001
2From: Takeshi Saito <takeshi.saito.xv@renesas.com>
3Date: Wed, 15 May 2019 20:23:46 +0200
4Subject: mmc: tmio: fix SCC error handling to avoid false positive CRC error
5
6From: Takeshi Saito <takeshi.saito.xv@renesas.com>
7
8commit 51b72656bb39fdcb8f3174f4007bcc83ad1d275f upstream.
9
10If an SCC error occurs during a read/write command execution, a false
11positive CRC error message is output.
12
13mmcblk0: response CRC error sending r/w cmd command, card status 0x900
14
15check_scc_error() checks SCC_RVSREQ.RVSERR bit. RVSERR detects a
16correction error in the next (up or down) delay tap position. However,
17since the command is successful, only retuning needs to be executed.
18This has been confirmed by HW engineers.
19
20Thus, on SCC error, set retuning flag instead of setting an error code.
21
22Fixes: b85fb0a1c8ae ("mmc: tmio: Fix SCC error detection")
23Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
24[wsa: updated comment and commit message, removed some braces]
25Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
26Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
27Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
28Cc: stable@vger.kernel.org
29Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
30Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32---
33 drivers/mmc/host/tmio_mmc_core.c | 3 ++-
34 1 file changed, 2 insertions(+), 1 deletion(-)
35
36--- a/drivers/mmc/host/tmio_mmc_core.c
37+++ b/drivers/mmc/host/tmio_mmc_core.c
38@@ -842,8 +842,9 @@ static void tmio_mmc_finish_request(stru
39 if (mrq->cmd->error || (mrq->data && mrq->data->error))
40 tmio_mmc_abort_dma(host);
41
42+ /* SCC error means retune, but executed command was still successful */
43 if (host->check_scc_error && host->check_scc_error(host))
44- mrq->cmd->error = -EILSEQ;
45+ mmc_retune_needed(host->mmc);
46
47 /* If SET_BLOCK_COUNT, continue with main command */
48 if (host->mrq && !mrq->cmd->error) {