]>
Commit | Line | Data |
---|---|---|
7c360069 GKH |
1 | From 2d51f3cd11f414c56a87dc018196b85fd50b04a4 Mon Sep 17 00:00:00 2001 |
2 | From: Julius Werner <jwerner@chromium.org> | |
3 | Date: Thu, 7 Nov 2013 10:59:14 -0800 | |
4 | Subject: usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED | |
5 | ||
6 | From: Julius Werner <jwerner@chromium.org> | |
7 | ||
8 | commit 2d51f3cd11f414c56a87dc018196b85fd50b04a4 upstream. | |
9 | ||
10 | This patch adds a check for USB_STATE_NOTATTACHED to the | |
11 | hub_port_warm_reset_required() workaround for ports that end up in | |
12 | Compliance Mode in hub_events() when trying to decide which reset | |
13 | function to use. Trying to call usb_reset_device() with a NOTATTACHED | |
14 | device will just fail and leave the port broken. | |
15 | ||
16 | Signed-off-by: Julius Werner <jwerner@chromium.org> | |
17 | Acked-by: Alan Stern <stern@rowland.harvard.edu> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/usb/core/hub.c | 5 +++-- | |
22 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
23 | ||
24 | --- a/drivers/usb/core/hub.c | |
25 | +++ b/drivers/usb/core/hub.c | |
26 | @@ -3891,8 +3891,9 @@ static void hub_events(void) | |
27 | hub->hdev->children[i - 1]; | |
28 | ||
29 | dev_dbg(hub_dev, "warm reset port %d\n", i); | |
30 | - if (!udev || !(portstatus & | |
31 | - USB_PORT_STAT_CONNECTION)) { | |
32 | + if (!udev || | |
33 | + !(portstatus & USB_PORT_STAT_CONNECTION) || | |
34 | + udev->state == USB_STATE_NOTATTACHED) { | |
35 | status = hub_port_reset(hub, i, | |
36 | NULL, HUB_BH_RESET_TIME, | |
37 | true); |