mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
@ 2023-04-11  8:31 Jimmy Hu
  2023-04-11  9:33 ` Oliver Neukum
  2023-04-11 13:55 ` Alan Stern
  0 siblings, 2 replies; 5+ messages in thread
From: Jimmy Hu @ 2023-04-11  8:31 UTC (permalink / raw)
  To: stern, gregkh; +Cc: badhri, linux-usb, linux-kernel, Jimmy Hu, stable

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


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

* Re: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
  2023-04-11  8:31 [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub Jimmy Hu
@ 2023-04-11  9:33 ` Oliver Neukum
  2023-04-11 13:55 ` Alan Stern
  1 sibling, 0 replies; 5+ messages in thread
From: Oliver Neukum @ 2023-04-11  9:33 UTC (permalink / raw)
  To: Jimmy Hu, stern, gregkh; +Cc: badhri, linux-usb, linux-kernel, stable



On 11.04.23 10:31, Jimmy Hu wrote:
> 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.

Hi,

out of interest, could you test whether this also applies to disconnections?
That is, does the hub reliably wake up if you unplug a device?

	Regards
		Oliver



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

* Re: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
  2023-04-11  8:31 [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub Jimmy Hu
  2023-04-11  9:33 ` Oliver Neukum
@ 2023-04-11 13:55 ` Alan Stern
  2023-04-12  1:55   ` Jimmy Hu
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Stern @ 2023-04-11 13:55 UTC (permalink / raw)
  To: Jimmy Hu; +Cc: gregkh, badhri, linux-usb, linux-kernel, stable

On Tue, Apr 11, 2023 at 08:31:45AM +0000, Jimmy Hu wrote:
> 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

This status value indicates that the port is in the U3 suspend state.  
Maybe the port needs to be put back into U0 before it can be reset.

> [  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.

It may be possible to fix the problem.  You should try that before 
giving up.

Alan Stern

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

* Re: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
  2023-04-11 13:55 ` Alan Stern
@ 2023-04-12  1:55   ` Jimmy Hu
  2023-04-12 12:35     ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Jimmy Hu @ 2023-04-12  1:55 UTC (permalink / raw)
  To: Alan Stern; +Cc: gregkh, badhri, linux-usb, linux-kernel, stable

On Tue, Apr 11, 2023 at 9:55 PM Alan Stern <stern@rowland.harvard.edu> wrote:
>
> On Tue, Apr 11, 2023 at 08:31:45AM +0000, Jimmy Hu wrote:
> > 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
>
> This status value indicates that the port is in the U3 suspend state.
> Maybe the port needs to be put back into U0 before it can be reset.
>
> > [  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.
>
> It may be possible to fix the problem.  You should try that before
> giving up.
>
> Alan Stern

[  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
When a USB3 device is connected to the hub,  it did finish the resume
and should be put back into U0, but it seems to have failed.

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

* Re: [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub
  2023-04-12  1:55   ` Jimmy Hu
@ 2023-04-12 12:35     ` Alan Stern
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Stern @ 2023-04-12 12:35 UTC (permalink / raw)
  To: Jimmy Hu; +Cc: gregkh, badhri, linux-usb, linux-kernel, stable

On Wed, Apr 12, 2023 at 09:55:02AM +0800, Jimmy Hu wrote:
> On Tue, Apr 11, 2023 at 9:55 PM Alan Stern <stern@rowland.harvard.edu> wrote:
> >
> > On Tue, Apr 11, 2023 at 08:31:45AM +0000, Jimmy Hu wrote:
> > > 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
> >
> > This status value indicates that the port is in the U3 suspend state.
> > Maybe the port needs to be put back into U0 before it can be reset.
> >
> > > [  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.
> >
> > It may be possible to fix the problem.  You should try that before
> > giving up.
> >
> > Alan Stern
> 
> [  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
> When a USB3 device is connected to the hub,  it did finish the resume
> and should be put back into U0, but it seems to have failed.

Those messages mean the hub's upstream port (the port on the hub which 
connects to the computer) is back in U0.  But I was talking about the 
downstream port (the port on the hub which connects to the device that 
was just plugged in).  That port is in U3.

Alan Stern

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

end of thread, other threads:[~2023-04-12 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11  8:31 [PATCH] usb: core: hub: Disable autosuspend for VIA VL813 USB3.0 hub Jimmy Hu
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

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®