From 6dc3f614d204f19ce220a974a8e3d4125b4e4d51 Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Thu, 15 Nov 2012 14:58:04 -0800 Subject: [PATCH] --- yaml --- r: 348683 b: refs/heads/master c: 4f43447e62b37ee19c82a13f72f35b1ca60a74d3 h: refs/heads/master i: 348681: 31dc5a9297d3ca901e392c061b67f2b97fcd2e83 348679: 43aaa29fb34314f9c04649ecba0a6624c96f4471 v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/hub.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 6380b12a720b..db4f8f98009a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 77c7f072c87fa951e9a74805febf26466f31170c +refs/heads/master: 4f43447e62b37ee19c82a13f72f35b1ca60a74d3 diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index b9ce5e8bda51..42566d774d18 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -2534,6 +2534,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, if (ret < 0) return ret; + /* The port state is unknown until the reset completes. */ + if ((portstatus & USB_PORT_STAT_RESET)) + goto delay; + /* * Some buggy devices require a warm reset to be issued even * when the port appears not to be connected. @@ -2579,11 +2583,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, if ((portchange & USB_PORT_STAT_C_CONNECTION)) return -ENOTCONN; - /* if we`ve finished resetting, then break out of - * the loop - */ - if (!(portstatus & USB_PORT_STAT_RESET) && - (portstatus & USB_PORT_STAT_ENABLE)) { + if ((portstatus & USB_PORT_STAT_ENABLE)) { if (hub_is_wusb(hub)) udev->speed = USB_SPEED_WIRELESS; else if (hub_is_superspeed(hub->hdev)) @@ -2597,10 +2597,10 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, return 0; } } else { - if (portchange & USB_PORT_STAT_C_BH_RESET) - return 0; + return 0; } +delay: /* switch to the long delay after two short delay failures */ if (delay_time >= 2 * HUB_SHORT_RESET_TIME) delay = HUB_LONG_RESET_TIME;