]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.18.114/usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.114 / usb-do-not-reset-if-a-low-speed-or-full-speed-device-timed-out.patch
CommitLineData
388682d7
GKH
1From 6e01827ed93947895680fbdad68c072a0f4e2450 Mon Sep 17 00:00:00 2001
2From: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
3Date: Thu, 4 Jan 2018 21:43:03 +0300
4Subject: usb: do not reset if a low-speed or full-speed device timed out
5
6From: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
7
8commit 6e01827ed93947895680fbdad68c072a0f4e2450 upstream.
9
10Some low-speed and full-speed devices (for example, bluetooth)
11do not have time to initialize. For them, ETIMEDOUT is a valid error.
12We need to give them another try. Otherwise, they will
13never be initialized correctly and in dmesg will be messages
14"Bluetooth: hci0 command 0x1002 tx timeout" or similars.
15
16Fixes: 264904ccc33c ("usb: retry reset if a device times out")
17Cc: stable <stable@vger.kernel.org>
18Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 drivers/usb/core/hub.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
25--- a/drivers/usb/core/hub.c
26+++ b/drivers/usb/core/hub.c
27@@ -4405,7 +4405,9 @@ hub_port_init (struct usb_hub *hub, stru
28 * reset. But only on the first attempt,
29 * lest we get into a time out/reset loop
30 */
31- if (r == 0 || (r == -ETIMEDOUT && retries == 0))
32+ if (r == 0 || (r == -ETIMEDOUT &&
33+ retries == 0 &&
34+ udev->speed > USB_SPEED_FULL))
35 break;
36 }
37 udev->descriptor.bMaxPacketSize0 =