Skip to content

Commit 67e2580

Browse files
matnymangregkh
authored andcommitted
usb: hub: Allow reset retry for USB2 devices on connect bounce
commit 1ac7db63333db1eeff901bfd6bbcd502b4634fa4 upstream. If the connect status change is set during reset signaling, but the status remains connected just retry port reset. This solves an issue with connecting a 90W HP Thunderbolt 3 dock with a Lenovo Carbon x1 (5th generation) which causes a 30min loop of a high speed device being re-discovererd before usb ports starts working. [...] [ 389.023845] usb 3-1: new high-speed USB device number 55 using xhci_hcd [ 389.491841] usb 3-1: new high-speed USB device number 56 using xhci_hcd [ 389.959928] usb 3-1: new high-speed USB device number 57 using xhci_hcd [...] This is caused by a high speed device that doesn't successfully go to the enabled state after the second port reset. Instead the connection bounces (connected, with connect status change), bailing out completely from enumeration just to restart from scratch. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1716332 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d012ab2 commit 67e2580

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/usb/core/hub.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,13 +2656,16 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
26562656
if (!(portstatus & USB_PORT_STAT_CONNECTION))
26572657
return -ENOTCONN;
26582658

2659-
/* bomb out completely if the connection bounced. A USB 3.0
2660-
* connection may bounce if multiple warm resets were issued,
2659+
/* Retry if connect change is set but status is still connected.
2660+
* A USB 3.0 connection may bounce if multiple warm resets were issued,
26612661
* but the device may have successfully re-connected. Ignore it.
26622662
*/
26632663
if (!hub_is_superspeed(hub->hdev) &&
2664-
(portchange & USB_PORT_STAT_C_CONNECTION))
2665-
return -ENOTCONN;
2664+
(portchange & USB_PORT_STAT_C_CONNECTION)) {
2665+
usb_clear_port_feature(hub->hdev, port1,
2666+
USB_PORT_FEAT_C_CONNECTION);
2667+
return -EAGAIN;
2668+
}
26662669

26672670
if (!(portstatus & USB_PORT_STAT_ENABLE))
26682671
return -EBUSY;

0 commit comments

Comments
 (0)