linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Yangbo Lu <yangbo.lu@nxp.com>,
	linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] mmc: sdhci: fix up CMD12 sending
Date: Fri, 29 Nov 2019 11:17:19 +0200	[thread overview]
Message-ID: <d16270bd-7d88-2c6e-252c-7df191ef2e59@intel.com> (raw)
In-Reply-To: <20191114111814.35199-1-yangbo.lu@nxp.com>

On 14/11/19 1:18 pm, Yangbo Lu 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>

Sorry for the delay.  This looks good to me.  Sending a STOP command
on the error path in the auto-CMD12 case should be fine whether it has
been sent already or not.

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

> ---
>  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);
> 


       reply	other threads:[~2019-11-29  9:18 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 ` Adrian Hunter [this message]
2019-12-10  9:51 ` [PATCH] mmc: sdhci: fix up CMD12 sending Ulf Hansson
2020-01-08  9:37   ` Y.b. Lu
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=d16270bd-7d88-2c6e-252c-7df191ef2e59@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yangbo.lu@nxp.com \
    /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).