linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2] usb: do not reset if a low-speed or full-speed device timed out
@ 2018-03-23 13:11 Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-23 13:11 UTC (permalink / raw)
  To: Maxim Moseychuk; +Cc: linux-usb, stern, mathias.nyman

On Thu, Jan 04, 2018 at 09:43:03PM +0300, Maxim Moseychuk wrote:
> 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>
> ---
>  drivers/usb/core/hub.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index cf7bbcb9a63c..775d97035503 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -4524,7 +4524,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;

But can't we now get into a loop where this never happens?  We still
need to "fail" these slow devices somehow.

Do you have a device that this fixes a problem for?  I would think we
would have seen this issue before now, given that this change has been
present in the tree for quite some time now.

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [v2] usb: do not reset if a low-speed or full-speed device timed out
@ 2018-03-23 13:39 Maxim Moseychuk
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Moseychuk @ 2018-03-23 13:39 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, Alan Stern, mathias.nyman

My "0cf3:3004 Qualcomm Atheros Communications AR3012 Bluetooth 4.0"
work correct only with this patch.
On vanilla kernel this device can work long time or can stop at once
boot with log "hci0 command 0x041f tx timeout". Hex number can be
different.

Many users report this bug.

https://bugzilla.kernel.org/show_bug.cgi?id=121201
https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1591167
https://ubuntuforums.org/showthread.php?t=2324071

I don't know affected non-bluetooth devices, because for other device
class be different dmesg message.



lsusb

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0cf3:3004 Qualcomm Atheros Communications
AR3012 Bluetooth 4.0
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 04f2:b331 Chicony Electronics Co., Ltd
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -t

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Video, Driver=uvcvideo, 5000M
    |__ Port 1: Dev 2, If 1, Class=Video, Driver=uvcvideo, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 2: Dev 3, If 0, Class=Human Interface Device,
Driver=usbhid, 12M
        |__ Port 2: Dev 3, If 1, Class=Human Interface Device,
Driver=usbhid, 12M
        |__ Port 2: Dev 3, If 2, Class=Human Interface Device,
Driver=usbhid, 12M
        |__ Port 3: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 3: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

lspci

00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM
Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core
processor PCI Express Root Port (rev 09)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core
processor PCI Express Root Port (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset
Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C216
Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family
USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family
High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI
Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset
Family PCI Express Root Port 2 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI
Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family
USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC
Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family
6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus
Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce
GT 650M] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce
GT 650M] (rev a1)
03:00.0 Ethernet controller: Qualcomm Atheros AR8161 Gigabit Ethernet (rev 10)
04:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network
Adapter (rev 01)
05:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host
Controller (rev 30)
05:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host
Controller (rev 30)
05:00.3 System peripheral: JMicron Technology Corp. MS Host Controller (rev 30)
05:00.4 System peripheral: JMicron Technology Corp. xD Host Controller (rev 30)
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [v2] usb: do not reset if a low-speed or full-speed device timed out
@ 2018-01-04 18:43 Maxim Moseychuk
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Moseychuk @ 2018-01-04 18:43 UTC (permalink / raw)
  To: linux-usb; +Cc: gregkh, stern, mathias.nyman, Maxim Moseychuk

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")
Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
---
 drivers/usb/core/hub.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index cf7bbcb9a63c..775d97035503 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4524,7 +4524,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 =

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-23 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 13:11 [v2] usb: do not reset if a low-speed or full-speed device timed out Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2018-03-23 13:39 Maxim Moseychuk
2018-01-04 18:43 Maxim Moseychuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).