linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: Allow for long command timeouts
@ 2013-11-14  8:16 Adrian Hunter
  2013-12-13 10:45 ` Adrian Hunter
  2014-01-20 15:36 ` Chris Ball
  0 siblings, 2 replies; 5+ messages in thread
From: Adrian Hunter @ 2013-11-14  8:16 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Adrian Hunter

The driver has a timer with a 10 second
timeout to catch devices that stop responding.
However it is possible for commands to take
even longer than that.  Change the timer
timeout to reflect the command timeout.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index bd8a098..614a34d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1013,7 +1013,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 		mdelay(1);
 	}
 
-	mod_timer(&host->timer, jiffies + 10 * HZ);
+	timeout = jiffies;
+	if (!cmd->data && cmd->cmd_timeout_ms > 9000)
+		timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ;
+	else
+		timeout += 10 * HZ;
+	mod_timer(&host->timer, timeout);
 
 	host->cmd = cmd;
 
-- 
1.7.11.7


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

* Re: [PATCH] mmc: sdhci: Allow for long command timeouts
  2013-11-14  8:16 [PATCH] mmc: sdhci: Allow for long command timeouts Adrian Hunter
@ 2013-12-13 10:45 ` Adrian Hunter
  2014-01-13  7:06   ` Adrian Hunter
  2014-01-20 15:36 ` Chris Ball
  1 sibling, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2013-12-13 10:45 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Chris Ball, linux-mmc

Hi Chris

What about this one?

Regards
Adrian

On 14/11/13 10:16, Adrian Hunter wrote:
> The driver has a timer with a 10 second
> timeout to catch devices that stop responding.
> However it is possible for commands to take
> even longer than that.  Change the timer
> timeout to reflect the command timeout.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  drivers/mmc/host/sdhci.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index bd8a098..614a34d 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1013,7 +1013,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>  		mdelay(1);
>  	}
>  
> -	mod_timer(&host->timer, jiffies + 10 * HZ);
> +	timeout = jiffies;
> +	if (!cmd->data && cmd->cmd_timeout_ms > 9000)
> +		timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ;
> +	else
> +		timeout += 10 * HZ;
> +	mod_timer(&host->timer, timeout);
>  
>  	host->cmd = cmd;
>  
> 


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

* Re: [PATCH] mmc: sdhci: Allow for long command timeouts
  2013-12-13 10:45 ` Adrian Hunter
@ 2014-01-13  7:06   ` Adrian Hunter
  2014-01-20  6:17     ` Adrian Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2014-01-13  7:06 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Chris Ball, linux-mmc

Ping?


On 13/12/13 12:45, Adrian Hunter wrote:
> Hi Chris
> 
> What about this one?
> 
> Regards
> Adrian
> 
> On 14/11/13 10:16, Adrian Hunter wrote:
>> The driver has a timer with a 10 second
>> timeout to catch devices that stop responding.
>> However it is possible for commands to take
>> even longer than that.  Change the timer
>> timeout to reflect the command timeout.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  drivers/mmc/host/sdhci.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index bd8a098..614a34d 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1013,7 +1013,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>>  		mdelay(1);
>>  	}
>>  
>> -	mod_timer(&host->timer, jiffies + 10 * HZ);
>> +	timeout = jiffies;
>> +	if (!cmd->data && cmd->cmd_timeout_ms > 9000)
>> +		timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ;
>> +	else
>> +		timeout += 10 * HZ;
>> +	mod_timer(&host->timer, timeout);
>>  
>>  	host->cmd = cmd;
>>  
>>
> 
> 
> 


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

* Re: [PATCH] mmc: sdhci: Allow for long command timeouts
  2014-01-13  7:06   ` Adrian Hunter
@ 2014-01-20  6:17     ` Adrian Hunter
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2014-01-20  6:17 UTC (permalink / raw)
  To: Chris Ball, Chris Ball; +Cc: linux-mmc

Ping?

On 13/01/14 09:06, Adrian Hunter wrote:
> Ping?
> 
> 
> On 13/12/13 12:45, Adrian Hunter wrote:
>> Hi Chris
>>
>> What about this one?
>>
>> Regards
>> Adrian
>>
>> On 14/11/13 10:16, Adrian Hunter wrote:
>>> The driver has a timer with a 10 second
>>> timeout to catch devices that stop responding.
>>> However it is possible for commands to take
>>> even longer than that.  Change the timer
>>> timeout to reflect the command timeout.
>>>
>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>>> ---
>>>  drivers/mmc/host/sdhci.c | 7 ++++++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index bd8a098..614a34d 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -1013,7 +1013,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>>>  		mdelay(1);
>>>  	}
>>>  
>>> -	mod_timer(&host->timer, jiffies + 10 * HZ);
>>> +	timeout = jiffies;
>>> +	if (!cmd->data && cmd->cmd_timeout_ms > 9000)
>>> +		timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ;
>>> +	else
>>> +		timeout += 10 * HZ;
>>> +	mod_timer(&host->timer, timeout);
>>>  
>>>  	host->cmd = cmd;
>>>  
>>>
>>
>>
>>
> 
> 
> 


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

* Re: [PATCH] mmc: sdhci: Allow for long command timeouts
  2013-11-14  8:16 [PATCH] mmc: sdhci: Allow for long command timeouts Adrian Hunter
  2013-12-13 10:45 ` Adrian Hunter
@ 2014-01-20 15:36 ` Chris Ball
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Ball @ 2014-01-20 15:36 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc

Hi Adrian,

On Thu, Nov 14 2013, Adrian Hunter wrote:
> The driver has a timer with a 10 second
> timeout to catch devices that stop responding.
> However it is possible for commands to take
> even longer than that.  Change the timer
> timeout to reflect the command timeout.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Thanks, pushed to mmc-next for 3.14, sorry for the delay.

- Chris.
-- 
Chris Ball   <chris@printf.net>   <http://printf.net/>

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

end of thread, other threads:[~2014-01-20 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14  8:16 [PATCH] mmc: sdhci: Allow for long command timeouts Adrian Hunter
2013-12-13 10:45 ` Adrian Hunter
2014-01-13  7:06   ` Adrian Hunter
2014-01-20  6:17     ` Adrian Hunter
2014-01-20 15:36 ` Chris Ball

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