diff mbox series

[1/1,F/H] UBUNTU: SAUCE: Revert "usb: core: reduce power-on-good delay time of root hub"

Message ID 20210812133512.71874-2-chris.chiu@canonical.com
State New
Headers show
Series Fix usb hub failure caused by short power-on-good delay | expand

Commit Message

Chris Chiu Aug. 12, 2021, 1:35 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1939638

This reverts commit 49b64d3f82f33f9bdd313538795dc00c3f85090c.

The USB devices will fail to be detected if the power-on-good delay
of the root hub is not long enough. In the problematic root hub,
it claims 20 ms of bPwrOn2PwrGood in the hub descriptor, but we
have to increase it to 100ms to make all connected USB devices to
be correctly enumerated and detected. Revert the commit until a
formal fix from upstream.

Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
---
 drivers/usb/core/hub.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Stefan Bader Aug. 12, 2021, 1:47 p.m. UTC | #1
On 12.08.21 15:35, Chris Chiu wrote:
> BugLink: https://bugs.launchpad.net/bugs/1939638
> 
> This reverts commit 49b64d3f82f33f9bdd313538795dc00c3f85090c.
> 
> The USB devices will fail to be detected if the power-on-good delay
> of the root hub is not long enough. In the problematic root hub,
> it claims 20 ms of bPwrOn2PwrGood in the hub descriptor, but we
> have to increase it to 100ms to make all connected USB devices to
> be correctly enumerated and detected. Revert the commit until a
> formal fix from upstream.
> 
> Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>   drivers/usb/core/hub.h | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
> index 5bd2831dc992..92fc6c8f54eb 100644
> --- a/drivers/usb/core/hub.h
> +++ b/drivers/usb/core/hub.h
> @@ -147,10 +147,8 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
>   {
>   	unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;
>   
> -	if (!hub->hdev->parent)	/* root hub */
> -		return delay;
> -	else /* Wait at least 100 msec for power to become stable */
> -		return max(delay, 100U);
> +	/* Wait at least 100 msec for power to become stable */
> +	return max(delay, 100U);
>   }
>   
>   static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
>
diff mbox series

Patch

diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 5bd2831dc992..92fc6c8f54eb 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -147,10 +147,8 @@  static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
 {
 	unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;
 
-	if (!hub->hdev->parent)	/* root hub */
-		return delay;
-	else /* Wait at least 100 msec for power to become stable */
-		return max(delay, 100U);
+	/* Wait at least 100 msec for power to become stable */
+	return max(delay, 100U);
 }
 
 static inline int hub_port_debounce_be_connected(struct usb_hub *hub,