diff options
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index c55208299cf8..a12cab5314e9 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -435,6 +435,7 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe) | |||
435 | static void hub_power_on(struct usb_hub *hub) | 435 | static void hub_power_on(struct usb_hub *hub) |
436 | { | 436 | { |
437 | int port1; | 437 | int port1; |
438 | unsigned pgood_delay = hub->descriptor->bPwrOn2PwrGood * 2; | ||
438 | 439 | ||
439 | /* if hub supports power switching, enable power on each port */ | 440 | /* if hub supports power switching, enable power on each port */ |
440 | if ((hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) < 2) { | 441 | if ((hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) < 2) { |
@@ -444,8 +445,8 @@ static void hub_power_on(struct usb_hub *hub) | |||
444 | USB_PORT_FEAT_POWER); | 445 | USB_PORT_FEAT_POWER); |
445 | } | 446 | } |
446 | 447 | ||
447 | /* Wait for power to be enabled */ | 448 | /* Wait at least 100 msec for power to become stable */ |
448 | msleep(hub->descriptor->bPwrOn2PwrGood * 2); | 449 | msleep(max(pgood_delay, (unsigned) 100)); |
449 | } | 450 | } |
450 | 451 | ||
451 | static void hub_quiesce(struct usb_hub *hub) | 452 | static void hub_quiesce(struct usb_hub *hub) |
@@ -1469,8 +1470,8 @@ static int hub_port_reset(struct usb_hub *hub, int port1, | |||
1469 | /* return on disconnect or reset */ | 1470 | /* return on disconnect or reset */ |
1470 | switch (status) { | 1471 | switch (status) { |
1471 | case 0: | 1472 | case 0: |
1472 | /* TRSTRCY = 10 ms */ | 1473 | /* TRSTRCY = 10 ms; plus some extra */ |
1473 | msleep(10); | 1474 | msleep(10 + 40); |
1474 | /* FALL THROUGH */ | 1475 | /* FALL THROUGH */ |
1475 | case -ENOTCONN: | 1476 | case -ENOTCONN: |
1476 | case -ENODEV: | 1477 | case -ENODEV: |