Re: [PATCH v2] usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0

From: Alan Stern
Date: Wed Dec 15 2021 - 21:37:58 EST


On Thu, Dec 16, 2021 at 08:23:29AM +0800, Kai-Heng Feng wrote:
> On Wed, Dec 15, 2021 at 11:47 PM Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Wed, Dec 15, 2021 at 08:01:06PM +0800, Kai-Heng Feng wrote:

> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -1110,7 +1110,10 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
> > > } else {
> > > hub_power_on(hub, true);
> > > }
> > > - }
> > > + /* Give some time on remote wakeup to let links to transit to U0 */
> > > + } else if (hub_is_superspeed(hub->hdev))
> > > + msleep(20);
> >
> > Where did the 20-ms number come from? Is it mentioned in the spec as
> > the time required for a port to switch from U3 to U0?
>
> The 20ms is the minimal time the device take to bring link back to U0 reliably.
> The spec mentioned device has to transit the link to U0 before
> signaling remote wakeup.
> So do you think this requires a new quirk?

No, I just wondered where you got the number from. The patch looks fine; I
can't think of any reasonable way to improve it.

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Alan Stern