All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
@ 2017-09-30 15:38 Bernd Edlinger
  2017-10-02  7:13 ` Ulf Hansson
  0 siblings, 1 reply; 6+ messages in thread
From: Bernd Edlinger @ 2017-09-30 15:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: Ulf Hansson, Jaehoon Chung


Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 80bc4f3..0489707 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -285,7 +285,7 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 
 	if (readl_poll_timeout_atomic(host->regs + SDMMC_CMD, cmd_status,
 				      !(cmd_status & SDMMC_CMD_START),
-				      1, 500 * USEC_PER_MSEC))
+				      1, 5000 * USEC_PER_MSEC))
 		dev_err(&slot->mmc->class_dev,
 			"Timeout sending command (cmd %#x arg %#x status %#x)\n",
 			cmd, arg, cmd_status);
-- 
2.7.4

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

* Re: [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
  2017-09-30 15:38 [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec Bernd Edlinger
@ 2017-10-02  7:13 ` Ulf Hansson
  2017-10-02 13:29   ` Bernd Edlinger
  0 siblings, 1 reply; 6+ messages in thread
From: Ulf Hansson @ 2017-10-02  7:13 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: linux-mmc, Jaehoon Chung

On 30 September 2017 at 17:38, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>
> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>

Why?

> ---
>  drivers/mmc/host/dw_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 80bc4f3..0489707 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -285,7 +285,7 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
>
>         if (readl_poll_timeout_atomic(host->regs + SDMMC_CMD, cmd_status,
>                                       !(cmd_status & SDMMC_CMD_START),
> -                                     1, 500 * USEC_PER_MSEC))
> +                                     1, 5000 * USEC_PER_MSEC))
>                 dev_err(&slot->mmc->class_dev,
>                         "Timeout sending command (cmd %#x arg %#x status %#x)\n",
>                         cmd, arg, cmd_status);
> --
> 2.7.4

Kind regards
Uffe

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

* Re: [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
  2017-10-02  7:13 ` Ulf Hansson
@ 2017-10-02 13:29   ` Bernd Edlinger
  2017-10-25 12:52     ` Bernd Edlinger
  2017-10-26  1:11     ` Shawn Lin
  0 siblings, 2 replies; 6+ messages in thread
From: Bernd Edlinger @ 2017-10-02 13:29 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Jaehoon Chung

On 10/02/17 09:13, Ulf Hansson wrote:
> On 30 September 2017 at 17:38, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>>
>> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
> 
> Why?
> 

Obviously the 0.5 seconds time-out was not sufficent for me.
I experienced a time-out I believe it was with an erase command,
that took around one second to complete.  Not all brands of SD
card behave this way, but some do.

Incidentally I had a similar problem with a completely different
hardware, see: https://bugzilla.kernel.org/show_bug.cgi?id=107811
Should I send a patch for that as well?


Bernd.

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

* Re: [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
  2017-10-02 13:29   ` Bernd Edlinger
@ 2017-10-25 12:52     ` Bernd Edlinger
  2017-10-25 20:57       ` Ulf Hansson
  2017-10-26  1:11     ` Shawn Lin
  1 sibling, 1 reply; 6+ messages in thread
From: Bernd Edlinger @ 2017-10-25 12:52 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Jaehoon Chung

On 10/02/17 15:29, Bernd Edlinger wrote:
> On 10/02/17 09:13, Ulf Hansson wrote:
>> On 30 September 2017 at 17:38, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>>>
>>> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>
>> Why?
>>
> 
> Obviously the 0.5 seconds time-out was not sufficent for me.
> I experienced a time-out I believe it was with an erase command,
> that took around one second to complete.  Not all brands of SD
> card behave this way, but some do.
> 
> Incidentally I had a similar problem with a completely different
> hardware, see: https://bugzilla.kernel.org/show_bug.cgi?id=107811
> Should I send a patch for that as well?
> 
> 

Ping...

Is raising the time-out also controversial?

Bernd.

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

* Re: [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
  2017-10-25 12:52     ` Bernd Edlinger
@ 2017-10-25 20:57       ` Ulf Hansson
  0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2017-10-25 20:57 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: linux-mmc, Jaehoon Chung

On 25 October 2017 at 14:52, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
> On 10/02/17 15:29, Bernd Edlinger wrote:
>> On 10/02/17 09:13, Ulf Hansson wrote:
>>> On 30 September 2017 at 17:38, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>>>>
>>>> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>>
>>> Why?
>>>
>>
>> Obviously the 0.5 seconds time-out was not sufficent for me.
>> I experienced a time-out I believe it was with an erase command,
>> that took around one second to complete.  Not all brands of SD
>> card behave this way, but some do.
>>
>> Incidentally I had a similar problem with a completely different
>> hardware, see: https://bugzilla.kernel.org/show_bug.cgi?id=107811
>> Should I send a patch for that as well?
>>
>>
>
> Ping...
>
> Is raising the time-out also controversial?

Well, I think you should be using a timeout based on facts of the
command, not just some value.

Anyway, have a look at this series and see if it solves your problem.

https://lkml.org/lkml/2017/10/12/688

Kind regards
Uffe

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

* Re: [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec
  2017-10-02 13:29   ` Bernd Edlinger
  2017-10-25 12:52     ` Bernd Edlinger
@ 2017-10-26  1:11     ` Shawn Lin
  1 sibling, 0 replies; 6+ messages in thread
From: Shawn Lin @ 2017-10-26  1:11 UTC (permalink / raw)
  To: Bernd Edlinger; +Cc: Ulf Hansson, shawn.lin, linux-mmc, Jaehoon Chung


On 2017/10/2 21:29, Bernd Edlinger wrote:
> On 10/02/17 09:13, Ulf Hansson wrote:
>> On 30 September 2017 at 17:38, Bernd Edlinger <bernd.edlinger@hotmail.de> wrote:
>>>
>>> Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>
>> Why?
>>
> 
> Obviously the 0.5 seconds time-out was not sufficent for me.
> I experienced a time-out I believe it was with an erase command,
> that took around one second to complete.  Not all brands of SD
> card behave this way, but some do.

The timeout in mci_send_cmd is suffcient. Ideally SDMMC_CMD_START
should be cleared immediately once the cmd was sent out. The only
reason that it wasn't, is that at least one of the IO, including
cmd line and all data lines used, is kept low for whatever reason.

Per your description, the failed case suffers from a long busy time
due to the previous erase command(R1b). But I think the following
command which was expected to use data line, shouldn't be fired to
the host drivers at all without checking the busy state. Otherwise....


> 
> Incidentally I had a similar problem with a completely different
> hardware, see: https://bugzilla.kernel.org/show_bug.cgi?id=107811
> Should I send a patch for that as well?

are there more cases to be fixed?

> 
> 
> Bernd.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 


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

end of thread, other threads:[~2017-10-26  1:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30 15:38 [PATCH] mmc: dw_mmc: Increase the timeout in mci_send_cmd to 5 sec Bernd Edlinger
2017-10-02  7:13 ` Ulf Hansson
2017-10-02 13:29   ` Bernd Edlinger
2017-10-25 12:52     ` Bernd Edlinger
2017-10-25 20:57       ` Ulf Hansson
2017-10-26  1:11     ` Shawn Lin

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.