Skip to content

Commit 22454b7

Browse files
dwassenberggregkh
authored andcommitted
usb: core: Fix hub port connection events lost
This will clear the USB_PORT_FEAT_C_CONNECTION bit in case of a hub port reset only if a device is was attached to the hub port before resetting the hub port. Using a Lenovo T480s attached to the ultra dock it was not possible to detect some usb-c devices at the dock usb-c ports because the hub_port_reset code will clear the USB_PORT_FEAT_C_CONNECTION bit after the actual hub port reset. Using this device combo the USB_PORT_FEAT_C_CONNECTION bit was set between the actual hub port reset and the clear of the USB_PORT_FEAT_C_CONNECTION bit. This ends up with clearing the USB_PORT_FEAT_C_CONNECTION bit after the new device was attached such that it was not detected. This patch will not clear the USB_PORT_FEAT_C_CONNECTION bit if there is currently no device attached to the port before the hub port reset. This will avoid clearing the connection bit for new attached devices. Signed-off-by: Dennis Wassenberg <[email protected]> Acked-by: Mathias Nyman <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4b8440a commit 22454b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,9 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
28502850
USB_PORT_FEAT_C_BH_PORT_RESET);
28512851
usb_clear_port_feature(hub->hdev, port1,
28522852
USB_PORT_FEAT_C_PORT_LINK_STATE);
2853-
usb_clear_port_feature(hub->hdev, port1,
2853+
2854+
if (udev)
2855+
usb_clear_port_feature(hub->hdev, port1,
28542856
USB_PORT_FEAT_C_CONNECTION);
28552857

28562858
/*

0 commit comments

Comments
 (0)