summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2017-04-08 23:20:06 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2017-06-20 11:30:48 +0300
commit9820a5b1110126142c50a779622abab560d3fcc1 (patch)
treedb55a7b785b7dd92d0d3b9dec02f0ec397823d70 /drivers/mmc
parenta04e6bae9e6f12c3a2aa4c84d50d1dcb79ce9814 (diff)
downloadlinux-9820a5b1110126142c50a779622abab560d3fcc1.tar.xz
mmc: core: for data errors, take response of stop cmd into account
Some errors are flagged only with the next command after a multiblock transfer, e.g. ECC error. So, when checking for data transfer errors, we check the result from the stop command as well. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/block.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 58d4e653dd74..3c7efbdc8591 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1446,7 +1446,8 @@ static enum mmc_blk_status mmc_blk_err_check(struct mmc_card *card,
return MMC_BLK_RETRY;
}
- if (brq->data.error) {
+ /* Some errors (ECC) are flagged on the next commmand, so check stop, too */
+ if (brq->data.error || brq->stop.error) {
if (need_retune && !brq->retune_retry_done) {
pr_debug("%s: retrying because a re-tune was needed\n",
req->rq_disk->disk_name);
@@ -1454,7 +1455,7 @@ static enum mmc_blk_status mmc_blk_err_check(struct mmc_card *card,
return MMC_BLK_RETRY;
}
pr_err("%s: error %d transferring data, sector %u, nr %u, cmd response %#x, card status %#x\n",
- req->rq_disk->disk_name, brq->data.error,
+ req->rq_disk->disk_name, brq->data.error ?: brq->stop.error,
(unsigned)blk_rq_pos(req),
(unsigned)blk_rq_sectors(req),
brq->cmd.resp[0], brq->stop.resp[0]);