public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] MUSB timeout broken
@ 2011-07-04 16:12 Orjan Friberg
  2011-08-08 19:26 ` Remy Bohmer
  0 siblings, 1 reply; 4+ messages in thread
From: Orjan Friberg @ 2011-07-04 16:12 UTC (permalink / raw)
  To: u-boot

Use pre-decrement to leave timeout at 0 when the timeout happens (which is what
the timeout detecting code expects).

Signed-off-by: Orjan Friberg <of@flatfrog.com>
---
 drivers/usb/musb/musb_hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
index 974bb31..adcf7f7 100644
--- a/drivers/usb/musb/musb_hcd.c
+++ b/drivers/usb/musb/musb_hcd.c
@@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void)
 	 * should be a usb device connected.
 	 */
 	timeout = musb_cfg.timeout;
-	while (timeout--)
+	while (--timeout)
 		if (readb(&musbr->devctl) & MUSB_DEVCTL_HM)
 			break;
 
-- 
1.7.2.5

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

* [U-Boot] [PATCH v2] MUSB timeout broken
  2011-07-04 16:12 [U-Boot] [PATCH v2] MUSB timeout broken Orjan Friberg
@ 2011-08-08 19:26 ` Remy Bohmer
  2011-08-08 19:37   ` Remy Bohmer
  0 siblings, 1 reply; 4+ messages in thread
From: Remy Bohmer @ 2011-08-08 19:26 UTC (permalink / raw)
  To: u-boot

Hi,

2011/7/4 Orjan Friberg <of@flatfrog.com>:
> Use pre-decrement to leave timeout at 0 when the timeout happens (which is what
> the timeout detecting code expects).
>
> Signed-off-by: Orjan Friberg <of@flatfrog.com>
> ---
> ?drivers/usb/musb/musb_hcd.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
> index 974bb31..adcf7f7 100644
> --- a/drivers/usb/musb/musb_hcd.c
> +++ b/drivers/usb/musb/musb_hcd.c
> @@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void)
> ? ? ? ? * should be a usb device connected.
> ? ? ? ? */
> ? ? ? ?timeout = musb_cfg.timeout;
> - ? ? ? while (timeout--)
> + ? ? ? while (--timeout)
> ? ? ? ? ? ? ? ?if (readb(&musbr->devctl) & MUSB_DEVCTL_HM)
> ? ? ? ? ? ? ? ? ? ? ? ?break;
>

Applied to u-boot-usb

Thanks.

Remy

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

* [U-Boot] [PATCH v2] MUSB timeout broken
  2011-08-08 19:26 ` Remy Bohmer
@ 2011-08-08 19:37   ` Remy Bohmer
  2011-08-09  8:52     ` Orjan Friberg
  0 siblings, 1 reply; 4+ messages in thread
From: Remy Bohmer @ 2011-08-08 19:37 UTC (permalink / raw)
  To: u-boot

Hi,

> 2011/7/4 Orjan Friberg <of@flatfrog.com>:
>> Use pre-decrement to leave timeout at 0 when the timeout happens (which is what
>> the timeout detecting code expects).
>>
>> Signed-off-by: Orjan Friberg <of@flatfrog.com>
>> ---
>> ?drivers/usb/musb/musb_hcd.c | ? ?2 +-
>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
>> index 974bb31..adcf7f7 100644
>> --- a/drivers/usb/musb/musb_hcd.c
>> +++ b/drivers/usb/musb/musb_hcd.c
>> @@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void)
>> ? ? ? ? * should be a usb device connected.
>> ? ? ? ? */
>> ? ? ? ?timeout = musb_cfg.timeout;
>> - ? ? ? while (timeout--)
>> + ? ? ? while (--timeout)
>> ? ? ? ? ? ? ? ?if (readb(&musbr->devctl) & MUSB_DEVCTL_HM)
>> ? ? ? ? ? ? ? ? ? ? ? ?break;
>>
>
> Applied to u-boot-usb

Whoops... Not applied to u-boot-usb, since the timeout code is broken.
It should wait for a certain time, not a certain count.

Kind regards,

Remy

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

* [U-Boot] [PATCH v2] MUSB timeout broken
  2011-08-08 19:37   ` Remy Bohmer
@ 2011-08-09  8:52     ` Orjan Friberg
  0 siblings, 0 replies; 4+ messages in thread
From: Orjan Friberg @ 2011-08-09  8:52 UTC (permalink / raw)
  To: u-boot

On 2011-08-08 21:37, Remy Bohmer wrote:
> Whoops... Not applied to u-boot-usb, since the timeout code is broken.
> It should wait for a certain time, not a certain count.

Agreed, patch withdrawn.


-- 
Orjan Friberg
FlatFrog Laboratories AB

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

end of thread, other threads:[~2011-08-09  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04 16:12 [U-Boot] [PATCH v2] MUSB timeout broken Orjan Friberg
2011-08-08 19:26 ` Remy Bohmer
2011-08-08 19:37   ` Remy Bohmer
2011-08-09  8:52     ` Orjan Friberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox