Patchwork [U-Boot,v3,5/8] usb: hub: Fix enumration timeout

login
register
mail settings
Submitter Vivek Gautam
Date April 12, 2013, 11:04 a.m.
Message ID <1365764680-10917-6-git-send-email-gautam.vivek@samsung.com>
Download mbox | patch
Permalink /patch/236036/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Vivek Gautam - April 12, 2013, 11:04 a.m.
Patch b6d7852c increases timeout for enumeration, taking
worst case to be 10 sec.
get_timer() api returns timestamp in milliseconds, which is
what we are checking in the do-while() loop in usb_hub_configure()
(get_timer(start) < CONFIG_SYS_HZ * 10).
This should give us a required check for 10 seconds, and thereby
we don't need to add additional mdelay of 100 microseconds in
each cycle.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Reviewed-by: Vipin Kumar <vipin.kumar@st.com>
---

Changes from v2:
 - none

 common/usb_hub.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Patch

diff --git a/common/usb_hub.c b/common/usb_hub.c
index e4f4e3c..ab41943 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -443,7 +443,6 @@  static int usb_hub_configure(struct usb_device *dev)
 				(portstatus & USB_PORT_STAT_CONNECTION))
 				break;
 
-			mdelay(100);
 		} while (get_timer(start) < CONFIG_SYS_HZ * 10);
 
 		if (ret < 0)