From e7893cb3912f69fbc3d73adaa7b44d1d3ce19ea4 Mon Sep 17 00:00:00 2001 From: Basavaraj Natikar Date: Fri, 28 Apr 2023 19:30:56 +0530 Subject: [PATCH] BACKPORT: xhci: Improve the XHCI system resume time Avoid extra 120ms delay during system resume. The xHC controller may signal wake up to 120ms before showing which usb device caused the wake on the xHC port registers. The xhci driver therefore checks for port activity up to 120ms during resume, making sure that the hub driver can see the port change, and won't immediately runtime suspend back due to no port activity. This is however only needed for runtime resume as system resume will resume all child hubs and other child usb devices anyway. Fixes: 253f588c70f6 ("xhci: Improve detection of device initiated wake signal.") Signed-off-by: Basavaraj Natikar Acked-by: Mathias Nyman Link: https://lore.kernel.org/r/20230428140056.1318981-3-Basavaraj.Natikar@amd.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: William Wu (cherry picked from commit 1c024241d018cf9fc17aa8d95c3fe77d671d7142) Change-Id: Icf4e8c97b3d5f6e9550fcad0e748c7badf1b22df --- 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 cd344c52c682..eb50776257ec 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1258,7 +1258,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) * the first wake signalling failed, give it that chance. */ pending_portevent = xhci_pending_portevent(xhci); - if (!pending_portevent) { + if (!pending_portevent && !IS_ENABLED(CONFIG_ARCH_ROCKCHIP)) { msleep(120); pending_portevent = xhci_pending_portevent(xhci); }