summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>2018-01-04 21:43:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-03 11:18:44 +0200
commit7dc58b124697ea9ed723da03a47d42019f9ee7cb (patch)
tree1b9865209861621f8906c64d7299f14af597bbad
parentf81354e730f685e9dbc9572a7562ca03f0ec8616 (diff)
downloadlinux-stable-7dc58b124697ea9ed723da03a47d42019f9ee7cb.tar.gz
linux-stable-7dc58b124697ea9ed723da03a47d42019f9ee7cb.tar.bz2
linux-stable-7dc58b124697ea9ed723da03a47d42019f9ee7cb.zip
usb: do not reset if a low-speed or full-speed device timed out
commit 6e01827ed93947895680fbdad68c072a0f4e2450 upstream. Some low-speed and full-speed devices (for example, bluetooth) do not have time to initialize. For them, ETIMEDOUT is a valid error. We need to give them another try. Otherwise, they will never be initialized correctly and in dmesg will be messages "Bluetooth: hci0 command 0x1002 tx timeout" or similars. Fixes: 264904ccc33c ("usb: retry reset if a device times out") Cc: stable <stable@vger.kernel.org> Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/hub.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index ab1507c9c2b3..12486efb043f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4405,7 +4405,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
* reset. But only on the first attempt,
* lest we get into a time out/reset loop
*/
- if (r == 0 || (r == -ETIMEDOUT && retries == 0))
+ if (r == 0 || (r == -ETIMEDOUT &&
+ retries == 0 &&
+ udev->speed > USB_SPEED_FULL))
break;
}
udev->descriptor.bMaxPacketSize0 =