Linux USB
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] usb: xhci: report USB2 resume-exit timeout as an error
Date: Fri, 26 Jun 2026 14:06:13 +0300	[thread overview]
Message-ID: <47d81805-8975-488a-8632-cac09b4243bc@linux.intel.com> (raw)
In-Reply-To: <20260623140503.87226-1-pengpeng@iscas.ac.cn>

On 6/23/26 17:05, Pengpeng Hou wrote:
> xhci_handle_usb2_port_link_resume() waits for the USB2 resume exit
> completion after requesting U0. If that wait times out, it only logs a
> warning and then continues through the normal resume-done path, ending
> the port resume and marking the suspend change as completed.
> 
> Return -ETIMEDOUT on resume-exit timeout so the port status path reports
> an error instead of a successful resume. The patch still ends the
> usbcore port-resume accounting before returning. This is intended as an
> RFC patch because xHCI resume state handling is policy-sensitive.

Does this resolve some issue you are seeing?

xhci_handle_usb2_port_link_resume() is only called when xhci roothub
responds to hub driver GetPortStatus() request while port is in a xhci resume state.

Returning -ETIMEDOUT here will cause the GetPortStatus() request to complete
with -EPIPE status. This does not seem like the right choice here.

If resuming the port to U0 timed out then there was no xhci port event, and port
should still be in xhci resume state. USB2 does not have a "resume" state so
returning portstatus as USB_PORT_STAT_SUSPEND seems appropriate.

Ee should also reconsider if calling usb_hcd_end_port_resume() is right in
the timeout case.

It also looks like we accept any port event as a successful rexit_done completion.
If the event was due to a disconnect we will incorrectly still report port status
as connected , enabled and non-suspended for this usb2 device.

Thanks
Mathias


      reply	other threads:[~2026-06-26 11:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 14:05 [RFC PATCH] usb: xhci: report USB2 resume-exit timeout as an error Pengpeng Hou
2026-06-26 11:06 ` Mathias Nyman [this message]

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=47d81805-8975-488a-8632-cac09b4243bc@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=pengpeng@iscas.ac.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox