From: Greg KH <gregkh@linuxfoundation.org>
To: Jack Pham <jackp@codeaurora.org>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/4] xhci: Improve detection of device initiated wake signal.
Date: Wed, 22 Sep 2021 08:49:28 +0200 [thread overview]
Message-ID: <YUrR+CyEVWktMqQ7@kroah.com> (raw)
In-Reply-To: <20210922011643.GD3515@jackp-linux.qualcomm.com>
On Tue, Sep 21, 2021 at 06:16:43PM -0700, Jack Pham wrote:
> Hi Mathias,
>
> On Thu, Mar 11, 2021 at 01:53:51PM +0200, Mathias Nyman wrote:
> > A xHC USB 3 port might miss the first wake signal from a USB 3 device
> > if the port LFPS reveiver isn't enabled fast enough after xHC resume.
> >
> > xHC host will anyway be resumed by a PME# signal, but will go back to
> > suspend if no port activity is seen.
> > The device resends the U3 LFPS wake signal after a 100ms delay, but
> > by then host is already suspended, starting all over from the
> > beginning of this issue.
> >
> > USB 3 specs say U3 wake LFPS signal is sent for max 10ms, then device
> > needs to delay 100ms before resending the wake.
> >
> > Don't suspend immediately if port activity isn't detected in resume.
> > Instead add a retry. If there is no port activity then delay for 120ms,
> > and re-check for port activity.
>
> We have a use case with which this change is causing unnecessary delay.
> Consider a USB2* device is attached and host is initiating the resume.
> Since this is not a device initiated wakeup there wouldn't be any
> pending event seen on the PORTSC registers, yet this adds an additional
> 120ms delay to re-check the PORTSC before returning and allowing the USB
> core to perform resume signaling.
>
> Is there a way to avoid this delay in that case? Perhaps could we
> distinguish whether we arrive here at xhci_resume() due to a
> host-initiated resume vs. a device remote wakeup?
Do you have a proposed patch that would do such a thing? Given that you
are seeing the problem it should be easy for you to test :)
> * I think it should be similar for attached USB3 devices as well, since
> the host-initiated exit from U3 wouldn't happen until usb_port_resume().
Can you reliably detect "attached" devices?
thanks,
greg k-h
next prev parent reply other threads:[~2021-09-22 6:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 11:53 [PATCH 0/4] xhci fixes for usb-linus Mathias Nyman
2021-03-11 11:53 ` [PATCH 1/4] usb: xhci: do not perform Soft Retry for some xHCI hosts Mathias Nyman
2021-03-11 11:53 ` [PATCH 2/4] xhci: Improve detection of device initiated wake signal Mathias Nyman
2021-09-22 1:16 ` Jack Pham
2021-09-22 6:49 ` Greg KH [this message]
2021-03-11 11:53 ` [PATCH 3/4] usb: xhci: Fix ASMedia ASM1042A and ASM3242 DMA addressing Mathias Nyman
2021-03-11 11:53 ` [PATCH 4/4] xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state Mathias Nyman
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=YUrR+CyEVWktMqQ7@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jackp@codeaurora.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=stable@vger.kernel.org \
/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.