diff options
author | Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com> | 2018-01-04 13:43:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-25 08:10:32 -0400 |
commit | 6e01827ed93947895680fbdad68c072a0f4e2450 (patch) | |
tree | 50ffadeeb3d8855eeef1ba83d7c076f0789a9ce6 | |
parent | 3f0989e4d366b5affc222f01d2b6273258171946 (diff) |
usb: do not reset if a low-speed or full-speed device timed out
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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 92378594a86e..a86591772352 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -4555,7 +4555,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, | |||
4555 | * reset. But only on the first attempt, | 4555 | * reset. But only on the first attempt, |
4556 | * lest we get into a time out/reset loop | 4556 | * lest we get into a time out/reset loop |
4557 | */ | 4557 | */ |
4558 | if (r == 0 || (r == -ETIMEDOUT && retries == 0)) | 4558 | if (r == 0 || (r == -ETIMEDOUT && |
4559 | retries == 0 && | ||
4560 | udev->speed > USB_SPEED_FULL)) | ||
4559 | break; | 4561 | break; |
4560 | } | 4562 | } |
4561 | udev->descriptor.bMaxPacketSize0 = | 4563 | udev->descriptor.bMaxPacketSize0 = |