]>
Commit | Line | Data |
---|---|---|
9a7cb72c GKH |
1 | From 22454b79e6de05fa61a2a72d00d2eed798abbb75 Mon Sep 17 00:00:00 2001 |
2 | From: Dennis Wassenberg <dennis.wassenberg@secunet.com> | |
3 | Date: Tue, 13 Nov 2018 14:40:34 +0100 | |
4 | Subject: usb: core: Fix hub port connection events lost | |
5 | ||
6 | From: Dennis Wassenberg <dennis.wassenberg@secunet.com> | |
7 | ||
8 | commit 22454b79e6de05fa61a2a72d00d2eed798abbb75 upstream. | |
9 | ||
10 | This will clear the USB_PORT_FEAT_C_CONNECTION bit in case of a hub port reset | |
11 | only if a device is was attached to the hub port before resetting the hub port. | |
12 | ||
13 | Using a Lenovo T480s attached to the ultra dock it was not possible to detect | |
14 | some usb-c devices at the dock usb-c ports because the hub_port_reset code | |
15 | will clear the USB_PORT_FEAT_C_CONNECTION bit after the actual hub port reset. | |
16 | Using this device combo the USB_PORT_FEAT_C_CONNECTION bit was set between the | |
17 | actual hub port reset and the clear of the USB_PORT_FEAT_C_CONNECTION bit. | |
18 | This ends up with clearing the USB_PORT_FEAT_C_CONNECTION bit after the | |
19 | new device was attached such that it was not detected. | |
20 | ||
21 | This patch will not clear the USB_PORT_FEAT_C_CONNECTION bit if there is | |
22 | currently no device attached to the port before the hub port reset. | |
23 | This will avoid clearing the connection bit for new attached devices. | |
24 | ||
25 | Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> | |
26 | Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> | |
27 | Cc: stable <stable@vger.kernel.org> | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
29 | ||
30 | --- | |
31 | drivers/usb/core/hub.c | 4 +++- | |
32 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
33 | ||
34 | --- a/drivers/usb/core/hub.c | |
35 | +++ b/drivers/usb/core/hub.c | |
36 | @@ -2757,7 +2757,9 @@ static int hub_port_reset(struct usb_hub | |
37 | USB_PORT_FEAT_C_BH_PORT_RESET); | |
38 | usb_clear_port_feature(hub->hdev, port1, | |
39 | USB_PORT_FEAT_C_PORT_LINK_STATE); | |
40 | - usb_clear_port_feature(hub->hdev, port1, | |
41 | + | |
42 | + if (udev) | |
43 | + usb_clear_port_feature(hub->hdev, port1, | |
44 | USB_PORT_FEAT_C_CONNECTION); | |
45 | ||
46 | /* |