Linux USB
 help / color / mirror / Atom feed
From: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
To: <gregkh@linuxfoundation.org>, <stern@rowland.harvard.edu>,
	<mathias.nyman@intel.com>, <linux-usb@vger.kernel.org>
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Subject: [PATCH 2/2] xhci: Improve the XHCI resume time
Date: Tue, 18 Apr 2023 19:38:17 +0530	[thread overview]
Message-ID: <20230418140817.3651909-3-Basavaraj.Natikar@amd.com> (raw)
In-Reply-To: <20230418140817.3651909-1-Basavaraj.Natikar@amd.com>

xHC system resume time may increase due to a 120ms delay. A PME# signal
will trigger the xHC host to resume runtime, and the host must wait for a
missed U3 LFPS wake signal before re-checking for port activity. It may
be necessary to wait only for auto-resume cases. Add a check only for
runtime resume to avoid the delay for other PM events so that the resume
time can be improved.

Fixes: 253f588c70f6 ("xhci: Improve detection of device initiated wake signal.")
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
 drivers/usb/host/xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index a539e4dd54f7..a3ee80ee5d1e 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1315,7 +1315,7 @@ int xhci_resume(struct xhci_hcd *xhci, int event)
 		 * the first wake signalling failed, give it that chance.
 		 */
 		pending_portevent = xhci_pending_portevent(xhci);
-		if (!pending_portevent) {
+		if (!pending_portevent && event == PM_EVENT_AUTO_RESUME) {
 			msleep(120);
 			pending_portevent = xhci_pending_portevent(xhci);
 		}
-- 
2.25.1


  parent reply	other threads:[~2023-04-18 14:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 14:08 [PATCH 0/2] Handle PM events for pci resume Basavaraj Natikar
2023-04-18 14:08 ` [PATCH 1/2] USB: Extend pci resume function to handle PM events Basavaraj Natikar
2023-04-18 15:06   ` Alan Stern
2023-04-18 19:55     ` Basavaraj Natikar
2023-04-18 15:23   ` Greg KH
2023-04-18 19:57     ` Basavaraj Natikar
2023-04-18 14:08 ` Basavaraj Natikar [this message]
2023-04-18 15:25   ` [PATCH 2/2] xhci: Improve the XHCI resume time Greg KH
2023-04-18 20:10     ` Basavaraj Natikar
2023-04-20 17:03   ` Mark Hasemeyer
2023-04-21  4:58     ` Basavaraj Natikar
2023-04-24 15:05       ` Mathias Nyman
2023-04-25  0:09         ` Wesley Cheng
2023-04-25  9:04           ` Mathias Nyman
2023-04-25 19:54             ` Wesley Cheng
2023-04-25 10:20         ` Basavaraj Natikar

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=20230418140817.3651909-3-Basavaraj.Natikar@amd.com \
    --to=basavaraj.natikar@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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