aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorDominik Bozek <dominikx.bozek@intel.com>2018-04-13 13:42:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-22 10:03:21 -0400
commit5d111f5190848d6fb1c414dc57797efea3526a2f (patch)
treeb3176a1621d0111ba02ae263618cf9d28efd54df /drivers/usb/core/hub.c
parentf86c6888ddee4dd3169011b984de850620fcdda1 (diff)
usb: hub: Don't wait for connect state at resume for powered-off ports
wait_for_connected() wait till a port change status to USB_PORT_STAT_CONNECTION, but this is not possible if the port is unpowered. The loop will only exit at timeout. Such case take place if an over-current incident happen while system is in S3. Then during resume wait_for_connected() will wait 2s, which may be noticeable by the user. Signed-off-by: Dominik Bozek <dominikx.bozek@intel.com> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index f6ea16e9f6bb..9e79bcf03cde 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3371,6 +3371,10 @@ static int wait_for_connected(struct usb_device *udev,
3371 while (delay_ms < 2000) { 3371 while (delay_ms < 2000) {
3372 if (status || *portstatus & USB_PORT_STAT_CONNECTION) 3372 if (status || *portstatus & USB_PORT_STAT_CONNECTION)
3373 break; 3373 break;
3374 if (!port_is_power_on(hub, *portstatus)) {
3375 status = -ENODEV;
3376 break;
3377 }
3374 msleep(20); 3378 msleep(20);
3375 delay_ms += 20; 3379 delay_ms += 20;
3376 status = hub_port_status(hub, *port1, portstatus, portchange); 3380 status = hub_port_status(hub, *port1, portstatus, portchange);