All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Bean Huo <huobean@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Avri Altman <avri.altman@wdc.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Bean Huo (beanhuo)" <beanhuo@micron.com>
Subject: Re: [PATCH v1 2/2] mmc: core: No need to calculate the timeout value for CQE data transmission
Date: Tue, 14 Sep 2021 10:13:48 +0200	[thread overview]
Message-ID: <CAPDyKFpC6iei96n-UcRTNrxTaHeejzfQX+rka7GSwSZjXN7-4g@mail.gmail.com> (raw)
In-Reply-To: <20210907151204.118861-3-huobean@gmail.com>

On Tue, 7 Sept 2021 at 17:12, Bean Huo <huobean@gmail.com> wrote:
>
> From: Bean Huo <beanhuo@micron.com>
>
> In case CQE is enabled, the timeout value of data transmission is always
> set to be maximum in sdhci_cqe_enable(), so, calculating its timeout value
> is obviously superfluous. Change to return directly, which can save some CPU
> cycle time.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
>  drivers/mmc/core/core.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 240c5af793dc..0b571a3bc988 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -649,6 +649,7 @@ EXPORT_SYMBOL(mmc_wait_for_cmd);
>  void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
>  {
>         unsigned int mult;
> +       struct mmc_host *host = card->host;
>
>         /*
>          * SDIO cards only define an upper 1 s limit on access.
> @@ -659,6 +660,13 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
>                 return;
>         }
>
> +       /*
> +        * In case CQE is enabled, the timeout will be set a maximum timeout in
> +        * sdhci_cqe_enable(), so, no need to go through the below algorithm.
> +        */
> +       if (host->cqe_enabled)

 I don't think this is a good idea. For example, host->cqe_enabled is
set for the hsq case well.

> +               return;
> +
>         /*
>          * SD cards use a 100 multiplier rather than 10
>          */

Kind regards
Uffe

  reply	other threads:[~2021-09-14  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 15:12 [PATCH v1 0/2] Two nimor eMMc changes Bean Huo
2021-09-07 15:12 ` [PATCH v1 1/2] mmc: cqhci: Print out qcnt in case of timeout Bean Huo
2021-09-14 11:23   ` Ulf Hansson
2021-09-07 15:12 ` [PATCH v1 2/2] mmc: core: No need to calculate the timeout value for CQE data transmission Bean Huo
2021-09-14  8:13   ` Ulf Hansson [this message]
2021-09-15  9:54     ` Bean Huo
2021-09-15 12:48       ` 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=CAPDyKFpC6iei96n-UcRTNrxTaHeejzfQX+rka7GSwSZjXN7-4g@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=huobean@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.