[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFpC6iei96n-UcRTNrxTaHeejzfQX+rka7GSwSZjXN7-4g@mail.gmail.com>
Date: Tue, 14 Sep 2021 10:13:48 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Bean Huo <huobean@...il.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Linus Walleij <linus.walleij@...aro.org>,
Avri Altman <avri.altman@....com>,
linux-mmc <linux-mmc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Bean Huo (beanhuo)" <beanhuo@...ron.com>
Subject: Re: [PATCH v1 2/2] mmc: core: No need to calculate the timeout value
for CQE data transmission
On Tue, 7 Sept 2021 at 17:12, Bean Huo <huobean@...il.com> wrote:
>
> From: Bean Huo <beanhuo@...ron.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@...ron.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
Powered by blists - more mailing lists