Re: [PATCH] usb: xhci: prevent spurious root hub resume during suspend

From: Pei Xiao

Date: Tue Jun 30 2026 - 04:48:15 EST




在 2026/6/30 16:10, Mathias Nyman 写道:
> On 6/30/26 10:36, Pei Xiao wrote:
>> handle_port_status() unconditionally resumes the root hub when
>> hcd->state is HC_STATE_SUSPENDED, regardless of whether a device is
>> actually attached to the port.  This can cause system suspend to fail
>> with -EBUSY if a spurious port change event arrives on an empty port
>> after its bus has entered suspend.
>>
>> Fix this by checking PORT_CONNECT in handle_port_status() before
>> resuming the root hub.  If no device is actually present on the port,
>> the event is spurious and should be silently ignored rather than
>> aborting suspend.
>
> Doesn't this change prevent handling device disconnects on suspended
> hosts? 
>
*Thank you for your reply. I’m not familiar with xHCI or these registers.
 Can’t we tell the difference between a real unplug and a situation where
 the device is physically still attached but portsc reports a disconnect?

Thanks!
Pei*
> Thanks
> Mathias