X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fusb_hub.c;h=415b45c1f139451c685fd450a6477bde34859cab;hb=a64be6124a069c2eae87656175c4c2e479e901cb;hp=f621ddb9ab5debe7c6b65514f2b04ee408167bfc;hpb=6f4e050639241218987541f4729172e4e0e2ff31;p=u-boot diff --git a/common/usb_hub.c b/common/usb_hub.c index f621ddb9ab..415b45c1f1 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -489,11 +490,15 @@ static int usb_hub_configure(struct usb_device *dev) portstatus = le16_to_cpu(portsts->wPortStatus); portchange = le16_to_cpu(portsts->wPortChange); - if ((portchange & USB_PORT_STAT_C_CONNECTION) == - (portstatus & USB_PORT_STAT_CONNECTION)) + /* No connection change happened, wait a bit more. */ + if (!(portchange & USB_PORT_STAT_C_CONNECTION)) + continue; + + /* Test if the connection came up, and if so, exit. */ + if (portstatus & USB_PORT_STAT_CONNECTION) break; - } while (get_timer(start) < CONFIG_SYS_HZ * 10); + } while (get_timer(start) < CONFIG_SYS_HZ * 1); if (ret < 0) continue;