Skip to content

Commit e1959fa

Browse files
matnymangregkh
authored andcommitted
xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay
Some USB 3.1 enumeration issues were reported after the hub driver removed the minimum 100ms limit for the power-on-good delay. Since commit 90d28fb ("usb: core: reduce power-on-good delay time of root hub") the hub driver sets the power-on-delay based on the bPwrOn2PwrGood value in the hub descriptor. xhci driver has a 20ms bPwrOn2PwrGood value for both roothubs based on xhci spec section 5.4.8, but it's clearly not enough for the USB 3.1 devices, causing enumeration issues. Tests indicate full 100ms delay is needed. Reported-by: Walt Jr. Brake <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Fixes: 90d28fb ("usb: core: reduce power-on-good delay time of root hub") Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 439b08c commit e1959fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/host/xhci-hub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ static void xhci_common_hub_descriptor(struct xhci_hcd *xhci,
257257
{
258258
u16 temp;
259259

260-
desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.9 says 20ms max */
261260
desc->bHubContrCurrent = 0;
262261

263262
desc->bNbrPorts = ports;
@@ -292,6 +291,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
292291
desc->bDescriptorType = USB_DT_HUB;
293292
temp = 1 + (ports / 8);
294293
desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * temp;
294+
desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.8 says 20ms */
295295

296296
/* The Device Removable bits are reported on a byte granularity.
297297
* If the port doesn't exist within that byte, the bit is set to 0.
@@ -344,6 +344,7 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
344344
xhci_common_hub_descriptor(xhci, desc, ports);
345345
desc->bDescriptorType = USB_DT_SS_HUB;
346346
desc->bDescLength = USB_DT_SS_HUB_SIZE;
347+
desc->bPwrOn2PwrGood = 50; /* usb 3.1 may fail if less than 100ms */
347348

348349
/* header decode latency should be zero for roothubs,
349350
* see section 4.23.5.2.

0 commit comments

Comments
 (0)