Skip to contentSkip to conversation

MUSB timeout broken

PATCH Superseded Orjan Friberg 2 participants 4 messages Jul 4, 2011 – Aug 9, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 MUSB timeout broken

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

---
 drivers/usb/musb/musb_hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/musb/musb_hcd.c +1 -1
index 974bb31..adcf7f7 100644
@@ -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;
 
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH v2 1/1 MUSB timeout broken

Hi,

2011/7/4 Orjan Friberg <[email protected]>:

Quoted 13 lines

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

---
?drivers/usb/musb/musb_hcd.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/usb/musb/musb_hcd.c +0 -0
index 974bb31..adcf7f7 100644
@@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void)
Quoted 8 lines

? ? ? ? * 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

#2 lore raw

PATCH v2 1/1 MUSB timeout broken

Hi,

Quoted 9 lines

2011/7/4 Orjan Friberg <[email protected]>:

Quoted 8 lines

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

---
?drivers/usb/musb/musb_hcd.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

Quoted 15 lines
Quoted 5 lines
drivers/usb/musb/musb_hcd.c +0 -0
index 974bb31..adcf7f7 100644
@@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void)
Quoted 8 lines

? ? ? ? * 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

#3 lore raw

PATCH v2 1/1 MUSB timeout broken

Quoted 2 lines · Remy Bohmer

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.

Signature · 2 lines
Orjan Friberg
FlatFrog Laboratories AB