public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Ulrich Hecht <uli+renesas@fpond.eu>
Subject: Re: [PATCH] mmc: disable tuning when checking card presence
Date: Mon, 21 Jun 2021 10:15:52 +0300	[thread overview]
Message-ID: <bbfbed66-5058-1263-159c-dabd345286c8@intel.com> (raw)
In-Reply-To: <CAPDyKFqkW9uwtJyWPFKggi2AJMtO4NJLW-6hviWgGSfoHyDm1A@mail.gmail.com>

On 18/06/21 1:42 pm, Ulf Hansson wrote:
> + Adrian
> 
> On Fri, 18 Jun 2021 at 10:23, Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
>>
>> When we use the alive callback, we expect a command to fail if the card
>> is not present. We should not trigger a retune then which will confuse
>> users with a failed retune on a removed card:
>>
>>  mmc2: tuning execution failed: -5
>>  mmc2: card 0001 removed
>>
>> Disable retuning in this code path.
>>
>> Reported-by: Ulrich Hecht <uli+renesas@fpond.eu>
>> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> ---
>>  drivers/mmc/core/core.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 54f0814f110c..eb792dd845a3 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -2088,6 +2088,9 @@ int _mmc_detect_card_removed(struct mmc_host *host)
>>         if (!host->card || mmc_card_removed(host->card))
>>                 return 1;
>>
>> +       /* we expect a failure if the card is removed */
>> +       mmc_retune_disable(host);
>> +
> 
> Some controllers require a retune after it has been runtime suspended.
> 
> In the above path, when called via the bus_ops->detect() callback, it
> could be that the controller may have been runtime suspended and then
> got resumed by the call to mmc_get_card().
> 
> I think we need something more clever here, to make sure we don't end
> up in that situation. I have looped in Adrian, to see if has some
> ideas for how this can be fixed.

Can we clarify, is the only problem that the error message is confusing?

> 
>>         ret = host->bus_ops->alive(host);
>>
>>         /*
>> @@ -2107,6 +2110,8 @@ int _mmc_detect_card_removed(struct mmc_host *host)
>>                 pr_debug("%s: card remove detected\n", mmc_hostname(host));
>>         }
>>
>> +       mmc_retune_enable(host);
>> +
>>         return ret;
>>  }
>>
>> --
>> 2.30.2
>>
> 
> Kind regards
> Uffe
> 


  reply	other threads:[~2021-06-21  7:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  8:23 [PATCH] mmc: disable tuning when checking card presence Wolfram Sang
2021-06-18 10:34 ` Ulrich Hecht
2021-06-18 10:42 ` Ulf Hansson
2021-06-21  7:15   ` Adrian Hunter [this message]
2021-06-21  7:32     ` Ulrich Hecht
2021-06-21  7:54       ` Adrian Hunter
2021-06-21  8:11         ` Wolfram Sang
2021-06-21  8:26           ` Adrian Hunter
2021-06-26 18:58             ` Wolfram Sang
2021-06-29 14:16               ` Ulf Hansson
2021-06-29 16:01                 ` Adrian Hunter
2021-06-30  4:08             ` Wolfram Sang

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=bbfbed66-5058-1263-159c-dabd345286c8@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=uli+renesas@fpond.eu \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.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