linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <stern@rowland.harvard.edu>, <gregkh@linuxfoundation.org>
Cc: mr.yming81@gmail.com, chunfeng.yun@mediatek.com,
	matthias.bgg@gmail.com, nishadkamdar@gmail.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, eddie.hung@mediatek.com,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH] xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay
Date: Fri,  5 Nov 2021 18:00:36 +0200	[thread overview]
Message-ID: <20211105160036.549516-1-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20211105133050.GA1590803@rowland.harvard.edu>

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 90d28fb53d4a ("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 <mr.yming81@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-hub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index a3f875eea751..af946c42b6f0 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -257,7 +257,6 @@ static void xhci_common_hub_descriptor(struct xhci_hcd *xhci,
 {
 	u16 temp;
 
-	desc->bPwrOn2PwrGood = 10;	/* xhci section 5.4.9 says 20ms max */
 	desc->bHubContrCurrent = 0;
 
 	desc->bNbrPorts = ports;
@@ -292,6 +291,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
 	desc->bDescriptorType = USB_DT_HUB;
 	temp = 1 + (ports / 8);
 	desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * temp;
+	desc->bPwrOn2PwrGood = 10;	/* xhci section 5.4.8 says 20ms */
 
 	/* The Device Removable bits are reported on a byte granularity.
 	 * 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,
 	xhci_common_hub_descriptor(xhci, desc, ports);
 	desc->bDescriptorType = USB_DT_SS_HUB;
 	desc->bDescLength = USB_DT_SS_HUB_SIZE;
+	desc->bPwrOn2PwrGood = 50;	/* usb 3.1 may fail if less than 100ms */
 
 	/* header decode latency should be zero for roothubs,
 	 * see section 4.23.5.2.
-- 
2.25.1


  reply	other threads:[~2021-11-05 16:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  1:20 [PATCH v2] usb: core: reduce power-on-good delay time of root hub Chunfeng Yun
2021-11-01  3:33 ` Walt Jr. Brake
     [not found] ` <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com>
2021-11-01 14:06   ` Alan Stern
2021-11-02  9:05     ` Mathias Nyman
2021-11-02 20:29       ` Walt Jr. Brake
2021-11-03 20:37         ` Mathias Nyman
2021-11-05 10:00           ` Greg Kroah-Hartman
2021-11-05 13:30             ` Alan Stern
2021-11-05 16:00               ` Mathias Nyman [this message]
2021-11-05 16:09                 ` [PATCH] xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay Mathias Nyman
2021-11-05 17:32                   ` Walt Jr. Brake
2021-11-05 19:41                     ` Mathias Nyman
2021-11-05 16:15                 ` Greg KH
2021-11-05 19:56                   ` Mathias Nyman
2021-11-06 14:41                     ` Greg KH

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=20211105160036.549516-1-mathias.nyman@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=eddie.hung@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mr.yming81@gmail.com \
    --cc=nishadkamdar@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --subject='Re: [PATCH] xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay' \
    /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

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