linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Y.b. Lu" <yangbo.lu@nxp.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Sachin Miglani <sachin.miglani@nxp.com>
Subject: RE: [PATCH] mmc: sdhci: fix up CMD12 sending
Date: Wed, 8 Jan 2020 09:37:22 +0000	[thread overview]
Message-ID: <AM7PR04MB68856B9D41A5867AB39D37F2F83E0@AM7PR04MB6885.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAPDyKFqfMzv1hFzPzS7w5BVHyXybu--7p11wHYa8WTQAVB7r4g@mail.gmail.com>

Hi Uffe and Adrian,

Back again on this topic. Actually we are trying to make the error recovery work after data error of CMD18 in linux-4.14.
With this patch, when CMD18 data error got, manual CMD12 would be sent. And then went into mmc_blk_cmd_recovery(). (Should be mmc_blk_mq_rw_recovery() in latest linux-5.5-rc2.)
In mmc_blk_cmd_recovery(), re-tuning would fail before sending CMD13 on our specific board.
This may be some issue related to specific eMMC card we are investigating.

The above is just background introduction, and you may not care about that:)
I'd like to have some queries on CMD12 usage in MMC driver.
1. It seems CMD12 is always not using ABORT type for sending in sdhci.c. The SDHCI_CMD_ABORTCMD hasn't been used. Is this issue?
2. In block.c, CMD12 uses R1 response for data reading and R1B response for writing. Is it ok to use R1 response for SD? The SD spec mentions only R1B response for CMD12.

Appreciate your helps.
Thanks.

Best regards,
Yangbo Lu

> -----Original Message-----
> From: Ulf Hansson <ulf.hansson@linaro.org>
> Sent: Tuesday, December 10, 2019 5:52 PM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: linux-mmc@vger.kernel.org; Adrian Hunter <adrian.hunter@intel.com>
> Subject: Re: [PATCH] mmc: sdhci: fix up CMD12 sending
> 
> On Thu, 14 Nov 2019 at 12:18, Yangbo Lu <yangbo.lu@nxp.com> wrote:
> >
> > The STOP command is disabled for multiple blocks r/w commands
> > with auto CMD12, when start to send. However, if there is data
> > error, software still needs to send CMD12 according to SD spec.
> > This patch is to allow software CMD12 sending for this case.
> >
> > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> 
> Applied for next, thanks!
> 
> Let's see how things go, then we can decide whether to add stable tag as well.
> 
> Kind regards
> Uffe
> 
> 
> > ---
> >  drivers/mmc/host/sdhci.c | 17 +++--------------
> >  1 file changed, 3 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index 09cdbe8..3041c39 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -1326,12 +1326,12 @@ static void sdhci_finish_data(struct sdhci_host
> *host)
> >
> >         /*
> >          * Need to send CMD12 if -
> > -        * a) open-ended multiblock transfer (no CMD23)
> > +        * a) open-ended multiblock transfer not using auto CMD12 (no
> CMD23)
> >          * b) error in multiblock transfer
> >          */
> >         if (data->stop &&
> > -           (data->error ||
> > -            !data->mrq->sbc)) {
> > +           ((!data->mrq->sbc && !sdhci_auto_cmd12(host, data->mrq)) ||
> > +            data->error)) {
> >                 /*
> >                  * 'cap_cmd_during_tfr' request must not use the
> command line
> >                  * after mmc_command_done() has been called. It is
> upper layer's
> > @@ -1825,17 +1825,6 @@ void sdhci_request(struct mmc_host *mmc,
> struct mmc_request *mrq)
> >
> >         sdhci_led_activate(host);
> >
> > -       /*
> > -        * Ensure we don't send the STOP for non-SET_BLOCK_COUNTED
> > -        * requests if Auto-CMD12 is enabled.
> > -        */
> > -       if (sdhci_auto_cmd12(host, mrq)) {
> > -               if (mrq->stop) {
> > -                       mrq->data->stop = NULL;
> > -                       mrq->stop = NULL;
> > -               }
> > -       }
> > -
> >         if (!present || host->flags & SDHCI_DEVICE_DEAD) {
> >                 mrq->cmd->error = -ENOMEDIUM;
> >                 sdhci_finish_mrq(host, mrq);
> > --
> > 2.7.4
> >

  reply	other threads:[~2020-01-08  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191114111814.35199-1-yangbo.lu@nxp.com>
2019-11-29  9:17 ` [PATCH] mmc: sdhci: fix up CMD12 sending Adrian Hunter
2019-12-10  9:51 ` Ulf Hansson
2020-01-08  9:37   ` Y.b. Lu [this message]
2020-01-16 15:36     ` Ulf Hansson
2020-01-17 14:15       ` Adrian Hunter

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=AM7PR04MB68856B9D41A5867AB39D37F2F83E0@AM7PR04MB6885.eurprd04.prod.outlook.com \
    --to=yangbo.lu@nxp.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sachin.miglani@nxp.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;
as well as URLs for NNTP newsgroup(s).