All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Haijun <B42677@freescale.com>
To: Barry Song <21cnbao@gmail.com>
Cc: Haijun Zhang <Haijun.Zhang@freescale.com>,
	linux-mmc@vger.kernel.org, cbouatmailru@gmail.com,
	cjb@laptop.org
Subject: Re: [PATCH V2] mmc:sdhci: Wait longer for command with busy flags
Date: Fri, 9 Aug 2013 14:47:29 +0800	[thread overview]
Message-ID: <52049081.2050907@freescale.com> (raw)
In-Reply-To: <CAGsJ_4xjsoqwhRjt+xjqcnfDyjKejk2EXZHGWX4x7X1kvnMaSw@mail.gmail.com>

On 08/09/2013 02:39 PM, Barry Song wrote:
> 2013/8/9 Haijun Zhang <Haijun.Zhang@freescale.com>:
>> When command with busy flags send and also data busy end interrupt
>> will be generate, the command will be finished when data transfer
>> complete or data busy state end, Sometimes this will expend more than
>> 10*Hz time to finish this command, so we should wait longer to detect
>> command complete timeout err.
>>
>> Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>
>> ---
>> changes for V2:
>>          - Correct the timer
>>
>>   drivers/mmc/host/sdhci.c | 14 +++++++++++++-
>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index a78bd4f..8888578 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -986,6 +986,7 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>>          int flags;
>>          u32 mask;
>>          unsigned long timeout;
>> +       u32 timer = 10;
>>
>>          WARN_ON(host->cmd);
>>
>> @@ -1014,7 +1015,18 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>>                  mdelay(1);
>>          }
>>
>> -       mod_timer(&host->timer, jiffies + 10 * HZ);
>> +       /*
>> +        * When send a commmand with busy state and also the data busy end
>> +        * interrupt can be generate, the command will be finished when date
>> +        * transfer complete or busy state end. Sometimes this will expend
>> +        * more than 10*HZ, In this case whe should wait longer to detect
>> +        * command complete timeout err.
>> +        */
>> +       if ((host->cmd->flags & MMC_RSP_BUSY) &&
>> +                       !(host->quirks & SDHCI_QUIRK_NO_BUSY_IRQ))
>> +               timer = 1000;
>> +
>> +       mod_timer(&host->timer, jiffies + timer * HZ);
> haojun, do you mean we need to wait for 1 minutes and 40 seconds for
> timeout? it seems it is too large for a kernel.
1000 * HZ = 1000 * 1 / 250 = 4000ms, about 4s. On my platform.
>
>>          host->cmd = cmd;
>>
>> --
>> 1.8.0
>>
> -barry
>


-- 
Thanks & Regards

Haijun



  reply	other threads:[~2013-08-09  6:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  0:04 [PATCH V2] mmc:sdhci: Wait longer for command with busy flags Haijun Zhang
2013-08-09  6:39 ` Barry Song
2013-08-09  6:47   ` Zhang Haijun [this message]
2013-08-09  8:30     ` Barry Song
2013-08-09  8:53       ` Jaehoon Chung
2013-08-09  9:07         ` Zhang Haijun

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=52049081.2050907@freescale.com \
    --to=b42677@freescale.com \
    --cc=21cnbao@gmail.com \
    --cc=Haijun.Zhang@freescale.com \
    --cc=cbouatmailru@gmail.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.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.