Skip to contentSkip to conversation

USB: relax usbcore reset timings

PATCH New Wolfgang Grandegger 4 participants 5 messages Dec 21, 2011 – Feb 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: relax usbcore reset timings

From: Wolfgang Grandegger <[email protected]>

Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports.

CC Remy Bohmer <[email protected]>
CC Vincent Palatin <[email protected]>
---
 common/usb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/usb.c +4 -1
index 63a11c8..d13dab8 100644
@@ -1035,6 +1035,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 {
 	int i;
 	struct usb_device *dev;
+	unsigned pgood_delay = hub->desc.bPwrOn2PwrGood * 2;
 
 	dev = hub->pusb_dev;
 	/* Enable power to the ports */
@@ -1042,8 +1043,10 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 	for (i = 0; i < dev->maxchild; i++) {
 		usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
 		USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
-		wait_ms(hub->desc.bPwrOn2PwrGood * 2);
 	}
+
+	/* Wait at least 100 msec for power to become stable */
+	wait_ms(max(pgood_delay, (unsigned)100));
 }
 
 void usb_hub_reset(void)
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/1 USB: relax usbcore reset timings

Hi,

2011/12/21 Wolfgang Grandegger <[email protected]>:

Quoted 8 lines

From: Wolfgang Grandegger <[email protected]>

Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports.

Quoted 6 lines
CC Remy Bohmer <[email protected]>
CC Vincent Palatin <[email protected]>

---
?common/usb.c | ? ?5 ++++-
?1 files changed, 4 insertions(+), 1 deletions(-)

Applied to u-boot-usb.
Thanks.

Kind regards,

Remy

#2 lore raw

PATCH 1/1 USB: relax usbcore reset timings

In reply to Wolfgang Grandegger
Quoted 8 lines

From: Wolfgang Grandegger <[email protected]>

Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports.

Quoted 4 lines
CC Remy Bohmer <[email protected]>
CC Vincent Palatin <[email protected]>

---

Hi,

what's the status of this patch/patchset?

Thanks
M

#3 lore raw

PATCH 1/1 USB: relax usbcore reset timings

Quoted 8 lines · Marek Vasut
Quoted 8 lines

From: Wolfgang Grandegger <[email protected]>

Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports.

Quoted 8 lines
Quoted 4 lines
CC Remy Bohmer <[email protected]>
CC Vincent Palatin <[email protected]>

---

Hi,

what's the status of this patch/patchset?

Already a while ago Remy wrote "Applied to u-boot-usb" but I can't find it yet in mainline. Remy?

Wolfgang

#4 lore raw

PATCH 1/1 USB: relax usbcore reset timings

Quoted 14 lines · Marek Vasut
Quoted 13 lines
Quoted 12 lines

From: Wolfgang Grandegger <[email protected]>

Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports.

CC Remy Bohmer <[email protected]>
CC Vincent Palatin <[email protected]>

---

Quoted 8 lines
Quoted 3 lines

Hi,

what's the status of this patch/patchset?

Already a while ago Remy wrote "Applied to u-boot-usb" but I can't find it yet in mainline. Remy?

Wolfgang

Well, Remy seems N/A recently, I'll apply these on my tree and send pull RQ after EW. Ok with you ?

M