diff options
| -rw-r--r-- | drivers/usb/core/hub.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b9ce5e8bda51..42566d774d18 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -2534,6 +2534,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
| 2534 | if (ret < 0) | 2534 | if (ret < 0) |
| 2535 | return ret; | 2535 | return ret; |
| 2536 | 2536 | ||
| 2537 | /* The port state is unknown until the reset completes. */ | ||
| 2538 | if ((portstatus & USB_PORT_STAT_RESET)) | ||
| 2539 | goto delay; | ||
| 2540 | |||
| 2537 | /* | 2541 | /* |
| 2538 | * Some buggy devices require a warm reset to be issued even | 2542 | * Some buggy devices require a warm reset to be issued even |
| 2539 | * when the port appears not to be connected. | 2543 | * when the port appears not to be connected. |
| @@ -2579,11 +2583,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
| 2579 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) | 2583 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) |
| 2580 | return -ENOTCONN; | 2584 | return -ENOTCONN; |
| 2581 | 2585 | ||
| 2582 | /* if we`ve finished resetting, then break out of | 2586 | if ((portstatus & USB_PORT_STAT_ENABLE)) { |
| 2583 | * the loop | ||
| 2584 | */ | ||
| 2585 | if (!(portstatus & USB_PORT_STAT_RESET) && | ||
| 2586 | (portstatus & USB_PORT_STAT_ENABLE)) { | ||
| 2587 | if (hub_is_wusb(hub)) | 2587 | if (hub_is_wusb(hub)) |
| 2588 | udev->speed = USB_SPEED_WIRELESS; | 2588 | udev->speed = USB_SPEED_WIRELESS; |
| 2589 | else if (hub_is_superspeed(hub->hdev)) | 2589 | else if (hub_is_superspeed(hub->hdev)) |
| @@ -2597,10 +2597,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
| 2597 | return 0; | 2597 | return 0; |
| 2598 | } | 2598 | } |
| 2599 | } else { | 2599 | } else { |
| 2600 | if (portchange & USB_PORT_STAT_C_BH_RESET) | 2600 | return 0; |
| 2601 | return 0; | ||
| 2602 | } | 2601 | } |
| 2603 | 2602 | ||
| 2603 | delay: | ||
| 2604 | /* switch to the long delay after two short delay failures */ | 2604 | /* switch to the long delay after two short delay failures */ |
| 2605 | if (delay_time >= 2 * HUB_SHORT_RESET_TIME) | 2605 | if (delay_time >= 2 * HUB_SHORT_RESET_TIME) |
| 2606 | delay = HUB_LONG_RESET_TIME; | 2606 | delay = HUB_LONG_RESET_TIME; |
