Re: [PATCH] usb: port: add delay after usb_hub_set_port_power()
From: Xu Yang
Date: Thu Feb 12 2026 - 05:28:19 EST
On Wed, Feb 11, 2026 at 10:04:32AM -0500, Alan Stern wrote:
> On Wed, Feb 11, 2026 at 06:36:28PM +0800, Xu Yang wrote:
> > When disable the root hub port, somehow the device is disconnected and
> > re-connected again. This happens because usb_clear_port_feature() does not
> > clear a truly happened port change. That says, in fact, port change event
> > may happen after usb_clear_port_feature() is called. Then the subsequent
> > port change event will have impact on usb device suspend routine.
>
> This is not a very good description of the problem. Here's a better
> one:
>
> When a port is disabled, an attached device will be disconnected. This
> causes a port-status-change event, which will race with hub autosuspend
> (if the disabled port was the only connected port on its hub), causing
> an immediate resume and a second autosuspend. Both of these can be
> avoided by adding a short delay after the call to
> usb_hub_set_port_power().
Thank you for providing a better one!
Thanks,
Xu Yang