Skip to content

Commit

Permalink
mmc: core: for data errors, take response of stop cmd into account
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Ulf Hansson committed Jun 20, 2017
1 parent a04e6ba commit 9820a5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mmc/core/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,15 +1446,16 @@ 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);
brq->retune_retry_done = 1;
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]);
Expand Down

0 comments on commit 9820a5b

Please sign in to comment.