diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-06-24 13:57:21 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-07-21 14:26:21 +0200 |
commit | bdf9e11d339ebc121e80e7ecdd44e0abcaf4ff38 (patch) | |
tree | 3d9345c8c31467fe31411cdc310a4750dd61b5af | |
parent | 29b19ff42a7d4c609f824c13ca139eef7332ff1f (diff) |
mmc: card: retry if transfer aborted due to out of range
This works around a issue we see when using eMMC 4.5 on tegra
SDHCI host controller.
-rw-r--r-- | drivers/mmc/card/block.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index bd5427d1f9e3..1583904a93a9 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -860,6 +860,15 @@ static int mmc_blk_err_check(struct mmc_card *card, if (brq->cmd.resp[0] & CMD_ERRORS) { pr_err("%s: r/w command failed, status = %#x\n", req->rq_disk->disk_name, brq->cmd.resp[0]); + + /* HACK: if the error is out of range, retry... */ + if (brq->cmd.resp[0] & R1_OUT_OF_RANGE) { + pr_info("%s: opcode: %x, arg: %x\n", req->rq_disk->disk_name, + brq->sbc.opcode, brq->sbc.arg); + pr_err("%s: I/O error, retrying...\n", req->rq_disk->disk_name); + return MMC_BLK_RETRY; + } + return MMC_BLK_ABORT; } |