mmc: mmci: send stop command if sbc error issue
authorLudovic Barre <ludovic.barre@st.com>
Wed, 7 Nov 2018 09:30:40 +0000 (10:30 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Dec 2018 07:26:24 +0000 (08:26 +0100)
Refer to "4.15 set block count command" of sd specification:
Host needs to issue CMD12 if any error is detected in
the CMD18 and CMD25 operations.

In sbc case, the data->stop is fill by framework.

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci.c

index 82bab35fff41f1e7ead0e78852d842a293c684f0..13fa640d86d6e366f0effbd61dcb7ef59d8e4e5d 100644 (file)
@@ -1190,11 +1190,10 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
                        /* The error clause is handled above, success! */
                        data->bytes_xfered = data->blksz * data->blocks;
 
-               if (!data->stop || host->mrq->sbc) {
+               if (!data->stop || (host->mrq->sbc && !data->error))
                        mmci_request_end(host, data->mrq);
-               } else {
+               else
                        mmci_start_command(host, data->stop, 0);
-               }
        }
 }