From: Yong Mao <yong.mao@mediatek.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
Eddie Huang <eddie.huang@mediatek.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Shawn Lin <shawn.lin@rock-chips.com>,
Chaotian Jing <chaotian.jing@mediatek.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] mmc: core: Fix CMD6 timeout issue
Date: Thu, 12 Jan 2017 20:13:31 +0800 [thread overview]
Message-ID: <1484223211.10824.5.camel@mhfsdcap03> (raw)
In-Reply-To: <CAPDyKFrYGz2zHZu2iNd09QxcBP5X4nvmYa85uAa7VtZjaH+USQ@mail.gmail.com>
On Thu, 2017-01-12 at 11:58 +0100, Ulf Hansson wrote:
> -trimmed cc list
>
> On 3 January 2017 at 09:49, Yong Mao <yong.mao@mediatek.com> wrote:
> > From: yong mao <yong.mao@mediatek.com>
> >
> > When initializing EMMC, after switch to HS400,
> > it will issue CMD6 to change ext_csd,
> > if first CMD6 got CRC error,
> > the repeat CMD6 may get timeout,
> > that's because card is not back to transfer state immediately.
> >
> > For resolving this issue, it need check if card is busy
> > before sending repeat CMD6.
> >
> > Not only CMD6 here has this issue, but also other R1B CMD has
> > the same issue.
>
> Is this change still something you want to discuss? Or the issue is resolved by:
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1308640.html
Yes. we still want to discuss this change with you.
The change in
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1308640.html resolves the other issue.
Please help to review this change and make some comments.
Thanks.
Best Regards,
Yong Mao.
>
> Kind regards
> Uffe
>
> >
> > Signed-off-by: Yong Mao <yong.mao@mediatek.com>
> > Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> > ---
> > drivers/mmc/core/core.c | 19 +++++++++++++++++++
> > 1 file changed, 19 insertions(+)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index 1076b9d..8674dbb 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -566,6 +566,25 @@ void mmc_wait_for_req_done(struct mmc_host *host, struct mmc_request *mrq)
> >
> > mmc_retune_recheck(host);
> >
> > + /*
> > + * If a R1B CMD such as CMD6 occur CRC error,
> > + * it will retry 3 times here.
> > + * But before retrying, it must ensure card is in
> > + * transfer state.
> > + * Otherwise, the next retried CMD will got TMO error.
> > + */
> > + if (mmc_resp_type(cmd) == MMC_RSP_R1B && host->ops->card_busy) {
> > + int tries = 500; /* Wait aprox 500ms at maximum */
> > +
> > + while (host->ops->card_busy(host) && --tries)
> > + mmc_delay(1);
> > +
> > + if (tries == 0) {
> > + cmd->error = -EBUSY;
> > + break;
> > + }
> > + }
> > +
> > pr_debug("%s: req failed (CMD%u): %d, retrying...\n",
> > mmc_hostname(host), cmd->opcode, cmd->error);
> > cmd->retries--;
> > --
> > 1.7.9.5
> >
next prev parent reply other threads:[~2017-01-12 12:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 8:49 [PATCH v2] Fix CMD6 timeout issue Yong Mao
2017-01-03 8:49 ` [PATCH v2 1/2] mmc: core: " Yong Mao
2017-01-12 10:58 ` Ulf Hansson
2017-01-12 12:13 ` Yong Mao [this message]
2017-01-12 15:21 ` Ulf Hansson
2017-01-13 3:35 ` Shawn Lin
2017-01-19 9:06 ` Yong Mao
[not found] ` <CAPDyKFrkehvdnYgau1zFmgcHUniMbcat_NOLkB7bSGWF+b=c9Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-19 8:58 ` Yong Mao
2017-01-19 21:13 ` Ulf Hansson
[not found] ` <1483433397-11756-1-git-send-email-yong.mao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-01-03 8:49 ` [PATCH v2 2/2] mmc: mediatek: correct the implementation of msdc_card_busy Yong Mao
2017-01-12 10:59 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484223211.10824.5.camel@mhfsdcap03 \
--to=yong.mao@mediatek.com \
--cc=adrian.hunter@intel.com \
--cc=chaotian.jing@mediatek.com \
--cc=chunfeng.yun@mediatek.com \
--cc=eddie.huang@mediatek.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox