[U-Boot] [PATCH v2 4/5] usb: hub: Fix enumration timeout

Vivek Gautam gautam.vivek at samsung.com
Mon Apr 8 12:35:57 CEST 2013


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 at samsung.com>
Reviewed-by: Vipin Kumar <vipin.kumar at st.com>
---
 common/usb_hub.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index 4bfed09..1757dc6 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -459,7 +459,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)
-- 
1.7.6.5



More information about the U-Boot mailing list