]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.4.75/usb-hub-use-correct-reset-for-wedged-usb3-devices-that-are-notattached.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.4.75 / usb-hub-use-correct-reset-for-wedged-usb3-devices-that-are-notattached.patch
CommitLineData
7c360069
GKH
1From 2d51f3cd11f414c56a87dc018196b85fd50b04a4 Mon Sep 17 00:00:00 2001
2From: Julius Werner <jwerner@chromium.org>
3Date: Thu, 7 Nov 2013 10:59:14 -0800
4Subject: usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED
5
6From: Julius Werner <jwerner@chromium.org>
7
8commit 2d51f3cd11f414c56a87dc018196b85fd50b04a4 upstream.
9
10This patch adds a check for USB_STATE_NOTATTACHED to the
11hub_port_warm_reset_required() workaround for ports that end up in
12Compliance Mode in hub_events() when trying to decide which reset
13function to use. Trying to call usb_reset_device() with a NOTATTACHED
14device will just fail and leave the port broken.
15
16Signed-off-by: Julius Werner <jwerner@chromium.org>
17Acked-by: Alan Stern <stern@rowland.harvard.edu>
18Signed-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);