linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] mmc: only print retune error when we don't check for card removal
@ 2021-06-30  4:16 Wolfram Sang
  2021-07-30 14:02 ` Wolfram Sang
  2021-08-04  7:11 ` Adrian Hunter
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2021-06-30  4:16 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Adrian Hunter, Wolfram Sang

Skip printing a retune error when we scan for a removed card because we
then expect a failed command.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

In my tests, detect_change was only set when a card was removed.
Inserting a card or resuming from RPM would print an error. Did I
overlook somethign or is this good to go?

 drivers/mmc/core/core.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index b039dcff17f8..b7e6e5640640 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -937,11 +937,13 @@ int mmc_execute_tuning(struct mmc_card *card)
 
 	err = host->ops->execute_tuning(host, opcode);
 
-	if (err)
+	if (!err)
+		mmc_retune_enable(host);
+
+	/* Only print error when we don't check for card removal */
+	if (err && !host->detect_change)
 		pr_err("%s: tuning execution failed: %d\n",
 			mmc_hostname(host), err);
-	else
-		mmc_retune_enable(host);
 
 	return err;
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] mmc: only print retune error when we don't check for card removal
  2021-06-30  4:16 [RFC PATCH] mmc: only print retune error when we don't check for card removal Wolfram Sang
@ 2021-07-30 14:02 ` Wolfram Sang
  2021-08-04  7:11 ` Adrian Hunter
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2021-07-30 14:02 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Yoshihiro Shimoda, Adrian Hunter

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

On Wed, Jun 30, 2021 at 06:16:58AM +0200, Wolfram Sang wrote:
> Skip printing a retune error when we scan for a removed card because we
> then expect a failed command.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> In my tests, detect_change was only set when a card was removed.
> Inserting a card or resuming from RPM would print an error. Did I
> overlook somethign or is this good to go?

So, what about this to remove the bogus 'retune failure' command?
I also think the code is a tad more readable this way.

> 
>  drivers/mmc/core/core.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index b039dcff17f8..b7e6e5640640 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -937,11 +937,13 @@ int mmc_execute_tuning(struct mmc_card *card)
>  
>  	err = host->ops->execute_tuning(host, opcode);
>  
> -	if (err)
> +	if (!err)
> +		mmc_retune_enable(host);
> +
> +	/* Only print error when we don't check for card removal */
> +	if (err && !host->detect_change)
>  		pr_err("%s: tuning execution failed: %d\n",
>  			mmc_hostname(host), err);
> -	else
> -		mmc_retune_enable(host);
>  
>  	return err;
>  }
> -- 
> 2.30.2
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] mmc: only print retune error when we don't check for card removal
  2021-06-30  4:16 [RFC PATCH] mmc: only print retune error when we don't check for card removal Wolfram Sang
  2021-07-30 14:02 ` Wolfram Sang
@ 2021-08-04  7:11 ` Adrian Hunter
  2021-08-06 13:07   ` Ulf Hansson
  1 sibling, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2021-08-04  7:11 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc; +Cc: linux-renesas-soc, Yoshihiro Shimoda

On 30/06/21 7:16 am, Wolfram Sang wrote:
> Skip printing a retune error when we scan for a removed card because we
> then expect a failed command.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Seems OK to me, but needs re-base. Nevertheless:

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

> ---
> 
> In my tests, detect_change was only set when a card was removed.
> Inserting a card or resuming from RPM would print an error. Did I
> overlook somethign or is this good to go?
> 
>  drivers/mmc/core/core.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index b039dcff17f8..b7e6e5640640 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -937,11 +937,13 @@ int mmc_execute_tuning(struct mmc_card *card)
>  
>  	err = host->ops->execute_tuning(host, opcode);
>  
> -	if (err)
> +	if (!err)
> +		mmc_retune_enable(host);
> +
> +	/* Only print error when we don't check for card removal */
> +	if (err && !host->detect_change)
>  		pr_err("%s: tuning execution failed: %d\n",
>  			mmc_hostname(host), err);
> -	else
> -		mmc_retune_enable(host);
>  
>  	return err;
>  }
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] mmc: only print retune error when we don't check for card removal
  2021-08-04  7:11 ` Adrian Hunter
@ 2021-08-06 13:07   ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2021-08-06 13:07 UTC (permalink / raw)
  To: Adrian Hunter, Wolfram Sang; +Cc: linux-mmc, Linux-Renesas, Yoshihiro Shimoda

On Wed, 4 Aug 2021 at 09:10, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> On 30/06/21 7:16 am, Wolfram Sang wrote:
> > Skip printing a retune error when we scan for a removed card because we
> > then expect a failed command.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Seems OK to me, but needs re-base. Nevertheless:
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>

I did the rebase myself and applied it for next, thanks to both of you!

Kind regards
Uffe


>
> > ---
> >
> > In my tests, detect_change was only set when a card was removed.
> > Inserting a card or resuming from RPM would print an error. Did I
> > overlook somethign or is this good to go?
> >
> >  drivers/mmc/core/core.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index b039dcff17f8..b7e6e5640640 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -937,11 +937,13 @@ int mmc_execute_tuning(struct mmc_card *card)
> >
> >       err = host->ops->execute_tuning(host, opcode);
> >
> > -     if (err)
> > +     if (!err)
> > +             mmc_retune_enable(host);
> > +
> > +     /* Only print error when we don't check for card removal */
> > +     if (err && !host->detect_change)
> >               pr_err("%s: tuning execution failed: %d\n",
> >                       mmc_hostname(host), err);
> > -     else
> > -             mmc_retune_enable(host);
> >
> >       return err;
> >  }
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-06 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30  4:16 [RFC PATCH] mmc: only print retune error when we don't check for card removal Wolfram Sang
2021-07-30 14:02 ` Wolfram Sang
2021-08-04  7:11 ` Adrian Hunter
2021-08-06 13:07   ` Ulf Hansson

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