summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaotian Jing <chaotian.jing@mediatek.com>2015-09-30 17:37:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-22 14:49:32 -0700
commita95e67a71e135bbbfaac89941f351843971927bc (patch)
treef8a549b0b7a3fb570992ab8bcdb3eaad711eec6f
parent31eea56030431c1b160f103cb69033ba94489cb2 (diff)
downloadlwn-a95e67a71e135bbbfaac89941f351843971927bc.tar.gz
lwn-a95e67a71e135bbbfaac89941f351843971927bc.zip
mmc: core: fix dead loop of mmc_retune
commit 031277d4d33d33f0174fbb569ca8f68238175617 upstream. When get a CRC error, start the mmc_retune, it will issue CMD19/CMD21 to do tune, assume there were 10 clock phase need to try, phase 0 to phase 6 is ok, phase 7 to phase 9 is NG, we try it from 0 to 9, so the last CMD19/CMD21 will get CRC error, host->need_retune was set and cause mmc_retune was called, then dead loop of mmc_retune Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Fixes: bd11e8bd03ca ("mmc: core: Flag re-tuning is needed on CRC errors") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mmc/core/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 9e3fdbdc4037..2f4503a7f315 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -134,9 +134,11 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
int err = cmd->error;
/* Flag re-tuning needed on CRC errors */
- if (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
+ if ((cmd->opcode != MMC_SEND_TUNING_BLOCK &&
+ cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
+ (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
(mrq->data && mrq->data->error == -EILSEQ) ||
- (mrq->stop && mrq->stop->error == -EILSEQ))
+ (mrq->stop && mrq->stop->error == -EILSEQ)))
mmc_retune_needed(host);
if (err && cmd->retries && mmc_host_is_spi(host)) {