Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236222

Re: [PATCH] mmc: core: fix dead loop of mmc_retune

From Adrian Hunter <adrian.hunter@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mmc: core: fix dead loop of mmc_retune
Date 2015-09-30 14:10 +0200
Message-ID <qeomT-4wT-21@gated-at.bofh.it> (permalink)
References <qembn-1aV-1@gated-at.bofh.it>
Organization Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki

Show all headers | View raw


On 30/09/15 12:37, Chaotian Jing wrote:
> 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>

Wasn't my idea to have this CRC checking in the core ;-) and sdhci
doesn't put it's tuning commands through a mmc request so it doesn't
see this issue.

But definitely the CRC logic is not meant for the tuning commands, so

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/core/core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 0520064..a3eb20b 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)) {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mmc: core: fix dead loop of mmc_retune Chaotian Jing <chaotian.jing@mediatek.com> - 2015-09-30 11:50 +0200
  Re: [PATCH] mmc: core: fix dead loop of mmc_retune Adrian Hunter <adrian.hunter@intel.com> - 2015-09-30 14:10 +0200
    Re: [PATCH] mmc: core: fix dead loop of mmc_retune Ulf Hansson <ulf.hansson@linaro.org> - 2015-09-30 14:50 +0200
  Re: [PATCH] mmc: core: fix dead loop of mmc_retune Ulf Hansson <ulf.hansson@linaro.org> - 2015-09-30 15:10 +0200

csiph-web