All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: shawn.lin@rock-chips.com, linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH v2] mmc: block: Use .card_busy() to detect busy state in card_busy_detect
Date: Mon, 5 Jul 2021 08:45:39 +0800	[thread overview]
Message-ID: <4d5b1836-e0f2-3a83-78f9-1a62d92d3873@rock-chips.com> (raw)
In-Reply-To: <CAPDyKFru-h=ypz2WN1Qoz0_XEa6ym6HD0OhEm6nx64C_Chef2Q@mail.gmail.com>

On 2021/7/2 23:00, Ulf Hansson wrote:
> On Tue, 8 Jun 2021 at 08:43, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>>
>> No need to send CMD13 if host driver supports .card_busy().
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> 
> Shawn, I just sent a small series that moves the mmc block layer into
> using the common mmc_poll_for_busy() code. I think $subject patch is
> better to be discussed as an improvement on top in that series.
> 
> I already have some thoughts about it, but I will be awaiting to
> provide you with some comment around it, until there is a new version
> from you.

Sure, I will take a close look at your patch-set.

Thanks.

> 
> Kind regards
> Uffe
> 
>>
>> ---
>>
>> Changes in v2:
>> - fix build issue
>>
>>   drivers/mmc/core/block.c | 9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
>> index 88f4c215..379614a9 100644
>> --- a/drivers/mmc/core/block.c
>> +++ b/drivers/mmc/core/block.c
>> @@ -417,10 +417,17 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
>>          unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
>>          int err = 0;
>>          u32 status;
>> +       bool busy;
>>
>>          do {
>>                  bool done = time_after(jiffies, timeout);
>>
>> +               if (card->host->ops->card_busy) {
>> +                       busy = card->host->ops->card_busy(card->host);
>> +                       status = busy ? 0 : R1_READY_FOR_DATA | R1_STATE_TRAN << 9;
>> +                       goto cb;
>> +               }
>> +
>>                  err = __mmc_send_status(card, &status, 5);
>>                  if (err) {
>>                          dev_err(mmc_dev(card->host),
>> @@ -431,7 +438,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
>>                  /* Accumulate any response error bits seen */
>>                  if (resp_errs)
>>                          *resp_errs |= status;
>> -
>> +cb:
>>                  /*
>>                   * Timeout if the device never becomes ready for data and never
>>                   * leaves the program state.
>> --
>> 2.7.4
>>
>>
>>
> 
> 
> 



      reply	other threads:[~2021-07-05  0:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  6:42 [PATCH v2] mmc: block: Use .card_busy() to detect busy state in card_busy_detect Shawn Lin
2021-07-02 15:00 ` Ulf Hansson
2021-07-05  0:45   ` Shawn Lin [this message]

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=4d5b1836-e0f2-3a83-78f9-1a62d92d3873@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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.