public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Baolin Wang <baolin.wang7@gmail.com>, ulf.hansson@linaro.org
Cc: arnd@arndb.de, orsonzhai@gmail.com, zhang.lyra@gmail.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] mmc: host: sdhci-sprd: Implement the request_atomic() API
Date: Tue, 14 Apr 2020 16:49:17 +0300	[thread overview]
Message-ID: <dbf41269-0d0c-084c-e090-b040f92fee3e@intel.com> (raw)
In-Reply-To: <60142fe6c6c1dbba2696e775564ae2166786f0bc.1586744073.git.baolin.wang7@gmail.com>

On 13/04/20 5:46 am, Baolin Wang wrote:
> Implement the request_atomic() API for nonremovable cards, that means
> we can submit next request in the irq hard handler context to reduce
> latency.
> 
> Moreover factor out the AUTO CMD23 checking into a separate function
> to reduce duplicate code.
> 
> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>

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

> ---
>  drivers/mmc/host/sdhci-sprd.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 2ab42c59e4f8..bc7a8cb84862 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -406,7 +406,8 @@ static struct sdhci_ops sdhci_sprd_ops = {
>  	.request_done = sdhci_sprd_request_done,
>  };
>  
> -static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)
> +static void sdhci_sprd_check_auto_cmd23(struct mmc_host *mmc,
> +					struct mmc_request *mrq)
>  {
>  	struct sdhci_host *host = mmc_priv(mmc);
>  	struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host);
> @@ -422,10 +423,23 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  	    mrq->sbc && (mrq->sbc->arg & SDHCI_SPRD_ARG2_STUFF) &&
>  	    (host->flags & SDHCI_AUTO_CMD23))
>  		host->flags &= ~SDHCI_AUTO_CMD23;
> +}
> +
> +static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)
> +{
> +	sdhci_sprd_check_auto_cmd23(mmc, mrq);
>  
>  	sdhci_request(mmc, mrq);
>  }
>  
> +static int sdhci_sprd_request_atomic(struct mmc_host *mmc,
> +				      struct mmc_request *mrq)
> +{
> +	sdhci_sprd_check_auto_cmd23(mmc, mrq);
> +
> +	return sdhci_request_atomic(mmc, mrq);
> +}
> +
>  static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>  {
>  	struct sdhci_host *host = mmc_priv(mmc);
> @@ -561,6 +575,11 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto pltfm_free;
>  
> +	if (!mmc_card_is_removable(host->mmc))
> +		host->mmc_host_ops.request_atomic = sdhci_sprd_request_atomic;
> +	else
> +		host->always_defer_done = true;
> +
>  	sprd_host = TO_SPRD_HOST(host);
>  	sdhci_sprd_phy_param_parse(sprd_host, pdev->dev.of_node);
>  
> @@ -654,8 +673,6 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto err_cleanup_host;
>  
> -	host->always_defer_done = true;
> -
>  	ret = __sdhci_add_host(host);
>  	if (ret)
>  		goto err_cleanup_host;
> 


  reply	other threads:[~2020-04-14 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13  2:46 [PATCH v5 0/3] Introduce the request_atomic() for the host Baolin Wang
2020-04-13  2:46 ` [PATCH v5 1/3] mmc: host: " Baolin Wang
2020-04-13  2:46 ` [PATCH v5 2/3] mmc: host: sdhci: Implement the request_atomic() API Baolin Wang
2020-04-13  4:40   ` kbuild test robot
2020-04-13  5:42   ` kbuild test robot
2020-04-13  6:52     ` Baolin Wang
2020-04-14 13:47   ` Adrian Hunter
2020-04-13  2:46 ` [PATCH v5 3/3] mmc: host: sdhci-sprd: " Baolin Wang
2020-04-14 13:49   ` Adrian Hunter [this message]
2020-04-17 11:29 ` [PATCH v5 0/3] Introduce the request_atomic() for the host 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=dbf41269-0d0c-084c-e090-b040f92fee3e@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=baolin.wang7@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zhang.lyra@gmail.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