mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jimmy Hu <hhhuuu@google.com>
To: stern@rowland.harvard.edu, gregkh@linuxfoundation.org
Cc: badhri@google.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jimmy Hu <hhhuuu@google.com>,
	stable@vger.kernel.org
Subject: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
Date: Tue, 11 Apr 2023 08:31:45 +0000	[thread overview]
Message-ID: <20230411083145.2214105-1-hhhuuu@google.com> (raw)

The VIA VL813 USB3.0 hub appears to have an issue with autosuspend and
detecting USB3 devices. This can be reproduced by connecting a USB3
device to the hub after the hub enters autosuspend mode.

//connect the hub
[  106.854204] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[  107.084993] usb 2-1: New USB device found, idVendor=2109, idProduct=0813, bcdDevice=90.15
[  107.094520] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  107.111836] usb 2-1: Product: USB3.0 Hub
[  107.116835] usb 2-1: Manufacturer: VIA Labs, Inc.
[  107.314230] hub 2-1:1.0: USB hub found
[  107.321356] hub 2-1:1.0: 4 ports detected

//the hub enters autosuspend mode
[  107.738873] hub 2-1:1.0: hub_suspend
[  107.922097] usb 2-1: usb auto-suspend, wakeup 1

//connect a USB3 device
[  133.120060] usb 2-1: usb wakeup-resume
[  133.160033] usb 2-1: Waited 0ms for CONNECT
[  133.165423] usb 2-1: finish resume
[  133.176919] hub 2-1:1.0: hub_resume
[  133.188026] usb 2-1-port3: status 0263 change 0041
[  133.323585] hub 2-1:1.0: state 7 ports 4 chg 0008 evt 0008
[  133.342423] usb 2-1-port3: link state change
[  133.358154] usb 2-1-port3: status 0263, change 0040, 5.0 Gb/s
[  133.875150] usb 2-1-port3: not reset yet, waiting 10ms
[  133.895502] usb 2-1-port3: not reset yet, waiting 10ms
[  133.918239] usb 2-1-port3: not reset yet, waiting 200ms
[  134.139529] usb 2-1-port3: not reset yet, waiting 200ms
[  134.365296] usb 2-1-port3: not reset yet, waiting 200ms
[  134.590185] usb 2-1-port3: not reset yet, waiting 200ms
[  134.641330] hub 2-1:1.0: state 7 ports 4 chg 0000 evt 0008
[  134.658880] hub 2-1:1.0: hub_suspend
[  134.792908] usb 2-1: usb auto-suspend, wakeup 1

Disabling autosuspend for this hub resolves the issue.

Signed-off-by: Jimmy Hu <hhhuuu@google.com>
Cc: stable@vger.kernel.org
---
 drivers/usb/core/hub.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 97a0f8faea6e..5c6455224d9d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -47,6 +47,8 @@
 #define USB_VENDOR_TEXAS_INSTRUMENTS		0x0451
 #define USB_PRODUCT_TUSB8041_USB3		0x8140
 #define USB_PRODUCT_TUSB8041_USB2		0x8142
+#define USB_VENDOR_VIA				0x2109
+#define USB_PRODUCT_VL813_USB3			0x0813
 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND	0x01
 #define HUB_QUIRK_DISABLE_AUTOSUSPEND		0x02
 
@@ -5866,6 +5868,11 @@ static const struct usb_device_id hub_id_table[] = {
       .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS,
       .idProduct = USB_PRODUCT_TUSB8041_USB3,
       .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
+    { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
+			| USB_DEVICE_ID_MATCH_PRODUCT,
+      .idVendor = USB_VENDOR_VIA,
+      .idProduct = USB_PRODUCT_VL813_USB3,
+      .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
     { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS,
       .bDeviceClass = USB_CLASS_HUB},
     { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,
-- 
2.40.0.577.gac1e443424-goog


             reply	other threads:[~2023-04-11  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  8:31 Jimmy Hu [this message]
2023-04-11  9:33 ` Oliver Neukum
2023-04-11 13:55 ` Alan Stern
2023-04-12  1:55   ` Jimmy Hu
2023-04-12 12:35     ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230411083145.2214105-1-hhhuuu@google.com \
    --to=hhhuuu@google.com \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®