All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Pei Xiao <xiaopei01@kylinos.cn>,
	mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stern@rowland.harvard.edu
Cc: dengjie03@kylinos.cn
Subject: Re: [PATCH] usb: xhci: prevent spurious root hub resume during suspend
Date: Tue, 30 Jun 2026 13:30:54 +0300	[thread overview]
Message-ID: <22af27b3-0595-4490-a9ab-9a7fdf4cef47@linux.intel.com> (raw)
In-Reply-To: <939cee9f-d4d7-4b42-8337-f765d39feb10@kylinos.cn>

On 6/30/26 11:43, Pei Xiao wrote:
> 
> 
> 在 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?

Not really. In your case it really looks like a disconnect.

Port Status: 0x202a0
	Disconnected
	Disabled
	Link: Rx Detect
	Powered
	Unknown port speed
	Connect Status Change

Is it only this specific device that disconnects on suspend, or can this be
reproduced with any usb device?

Thanks
Mathias

  reply	other threads:[~2026-06-30 10:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  7:36 [PATCH] usb: xhci: prevent spurious root hub resume during suspend Pei Xiao
2026-06-30  8:10 ` Mathias Nyman
2026-06-30  8:43   ` Pei Xiao
2026-06-30 10:30     ` Mathias Nyman [this message]
2026-07-01  1:10       ` Pei Xiao

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=22af27b3-0595-4490-a9ab-9a7fdf4cef47@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=dengjie03@kylinos.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=xiaopei01@kylinos.cn \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.