From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vipin Kumar Date: Thu, 28 Mar 2013 09:03:00 +0530 Subject: [U-Boot] [PATCH 4/7] usb: hub: Fix enumration timeout In-Reply-To: <1364376543-7526-5-git-send-email-gautam.vivek@samsung.com> References: <1364376543-7526-1-git-send-email-gautam.vivek@samsung.com> <1364376543-7526-5-git-send-email-gautam.vivek@samsung.com> Message-ID: <5153B9EC.502@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/27/2013 2:59 PM, Vivek Gautam wrote: > Patch b6d7852c increases timeout for enumeration, taking > worst case to be 10 sec. > get_timer() api returns timestamp in micro-seconds, 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 > CC: Vipin Kumar > --- > 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 0677004..d77f98d 100644 > --- a/common/usb_hub.c > +++ b/common/usb_hub.c > @@ -439,7 +439,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) With this change, we are continuously reading the uhb status. Although this is also OK, but I feel 100 ms delay is better Still, there is no harm even if this patch is added. So, Reviewed-by: Vipin Kumar