From: chaotian.jing@mediatek.com (Chaotian Jing)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: core: Do not hold re-tuning during CMD6 commands
Date: Fri, 24 Mar 2017 17:40:27 +0800 [thread overview]
Message-ID: <1490348427.22814.19.camel@mhfsdcap03> (raw)
In-Reply-To: <03d54000-9ced-1b31-df80-d254f02433db@intel.com>
On Fri, 2017-03-24 at 11:19 +0200, Adrian Hunter wrote:
> On 24/03/17 10:32, Chaotian Jing wrote:
> > On Fri, 2017-03-24 at 09:52 +0200, Adrian Hunter wrote:
> >> On 24/03/17 08:19, Chaotian Jing wrote:
> >>> this patch is refine for 'commit c6dbab9cb58f ("mmc: core: Hold re-tuning
> >>> during switch commands")'
> >>> Since it has 3 retries at max for CMD6, if the first CMD6 got CRC error,
> >>> then should do re-tune before the next CMD6 was sent.
> >>>
> >>> Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> >>> ---
> >>> drivers/mmc/core/mmc_ops.c | 3 +--
> >>> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
> >>> index fe80f26..6931927 100644
> >>> --- a/drivers/mmc/core/mmc_ops.c
> >>> +++ b/drivers/mmc/core/mmc_ops.c
> >>> @@ -534,8 +534,6 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
> >>> bool use_r1b_resp = use_busy_signal;
> >>> unsigned char old_timing = host->ios.timing;
> >>>
> >>> - mmc_retune_hold(host);
> >>> -
> >>> /*
> >>> * If the cmd timeout and the max_busy_timeout of the host are both
> >>> * specified, let's validate them. A failure means we need to prevent
> >>> @@ -567,6 +565,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
> >>> cmd.sanitize_busy = true;
> >>>
> >>> err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
> >>> + mmc_retune_hold(host);
> >>
> >> That is not how mmc_retune_hold() works, you need mmc_retune_hold_now() as
> >> it is here:
> >>
> >> https://marc.info/?l=linux-mmc&m=148940903816582
> >>
> >> But using "retries" with commands that have busy-waiting on the data line
> >> doesn't make much sense anyway. Particularly with CRC errors, I would
> >> expect the card is actually busily doing the switch and we need only to wait
> >> for it. The same can be true for timeout errors. For some CMD6 we might
> >> need to send CMD12 if the card is busy after an error. I would prefer an
> >> explicit attempt at recovery from CMD6 errors.
> >>
> >
> > It's the host driver's responsibility to ensure card is not in busy
> > state before issue the next R1B command, or the MMC core layer needs do
> > extra check/waiting before issue a R1B command.
>
> Better to deal with cards stuck in busy from the places where busy-waiting
> is expected.
>
Yes, if a R1B command got response CRC error, we can do busy-waiting in
the error hander funtion(mmc_wait_for_req_done())
> > I think the purpose of "re-tune" is trying to cover particular case(eg.
> > voltage fluctuate or EMI or some glitch of host/device which caused CRC
> > error)
>
> No, re-tuning is to compensate for drift caused primarily by temperature change.
>
Yes, by JEDEC spec, temperature change cause timing drift of EMMC
device, but, as you mentioned, maybe I have a hardware problem of host,
but needs Software to cover it. so that we are doing our best to do
re-tune if got CRC error. if could recover it, then it's better than
system hung.
> > error) , but in such cases, too many cases are disable re-tune function
> > by mmc_retune_hold(), for example, in this case, if a response CRC error
> > got then we never have chance to recover it. then cause system cannot
> > access emmc or suspend/resume fail.
>
> Maybe you have a hardware problem.
>
next prev parent reply other threads:[~2017-03-24 9:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 6:18 mmc: core: Do not hold re-tuning during CMD6 commands Chaotian Jing
2017-03-24 6:19 ` [PATCH] " Chaotian Jing
2017-03-24 7:52 ` Adrian Hunter
2017-03-24 8:32 ` Chaotian Jing
2017-03-24 9:19 ` Adrian Hunter
2017-03-24 9:40 ` Chaotian Jing [this message]
2017-03-24 10:49 ` Ulf Hansson
2017-03-27 1:35 ` Chaotian Jing
2017-03-28 8:30 ` Ulf Hansson
2017-03-28 9:01 ` Adrian Hunter
2017-03-28 9:58 ` Ulf Hansson
2017-03-28 9:59 ` Ulf Hansson
2017-03-29 2:27 ` Chaotian Jing
2017-03-28 9:59 ` Chaotian Jing
2017-03-29 10:33 ` Ulf Hansson
2017-03-29 10:36 ` Chaotian Jing
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=1490348427.22814.19.camel@mhfsdcap03 \
--to=chaotian.jing@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).