linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [RFC PATCH] mmc: core: ensure flags are always cleared when retune gets enabled
Date: Fri, 30 Jul 2021 16:00:41 +0200	[thread overview]
Message-ID: <YQQGCZ6a/z1ER8pa@ninjato> (raw)
In-Reply-To: <20210625190107.8160-1-wsa+renesas@sang-engineering.com>

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

On Fri, Jun 25, 2021 at 09:01:07PM +0200, Wolfram Sang wrote:
> Move the call to clear the retune flags into mmc_retune_enable() to
> ensure they are always cleared. With current code, there is no
> functional change. But it is more future-proof this way.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> After reviewing my own code, I thought this is even a tad better. What
> do you guys think? Based on the series "[PATCH 0/3] mmc: avoid vicious
> circle when retuning", of course.

Would be easy to apply now because the dependency is in mmc/next now.
Opinions?

> 
>  drivers/mmc/core/core.c | 6 ++----
>  drivers/mmc/core/host.c | 1 +
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 84f39a59a28e..b039dcff17f8 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -937,13 +937,11 @@ int mmc_execute_tuning(struct mmc_card *card)
>  
>  	err = host->ops->execute_tuning(host, opcode);
>  
> -	if (err) {
> +	if (err)
>  		pr_err("%s: tuning execution failed: %d\n",
>  			mmc_hostname(host), err);
> -	} else {
> -		mmc_retune_clear(host);
> +	else
>  		mmc_retune_enable(host);
> -	}
>  
>  	return err;
>  }
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 52d37587cf45..8ca1db6413f8 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -101,6 +101,7 @@ void mmc_unregister_host_class(void)
>   */
>  void mmc_retune_enable(struct mmc_host *host)
>  {
> +	mmc_retune_clear(host);
>  	host->can_retune = 1;
>  	if (host->retune_period)
>  		mod_timer(&host->retune_timer,
> -- 
> 2.30.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-07-30 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 19:01 Wolfram Sang
2021-07-30 14:00 ` Wolfram Sang [this message]
2021-08-04  7:06 ` 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=YQQGCZ6a/z1ER8pa@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --subject='Re: [RFC PATCH] mmc: core: ensure flags are always cleared when retune gets enabled' \
    /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

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