Takashi Iwai 4c7831
From 7c67cf6658cec70d8a43229f2ce74ca1443dc95e Mon Sep 17 00:00:00 2001
Takashi Iwai 4c7831
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
Takashi Iwai 4c7831
Date: Wed, 11 Dec 2019 16:20:05 +0200
Takashi Iwai 4c7831
Subject: [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend()
Takashi Iwai 4c7831
Git-commit: 7c67cf6658cec70d8a43229f2ce74ca1443dc95e
Takashi Iwai 4c7831
Patch-mainline: v5.5-rc2
Takashi Iwai 4c7831
References: bsc#1051510
Takashi Iwai 4c7831
Takashi Iwai 4c7831
I've recently observed failed xHCI suspend attempt on AMD Raven Ridge
Takashi Iwai 4c7831
System: 
Takashi Iwai 4c7831
Kernel: xhci_hcd 0000:04:00.4: WARN: xHC CMD_RUN timeout
Takashi Iwai 4c7831
Kernel: PM: suspend_common(): xhci_pci_suspend+0x0/0xd0 returns -110
Takashi Iwai 4c7831
Kernel: PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -110
Takashi Iwai 4c7831
Kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -110
Takashi Iwai 4c7831
Kernel: PM: Device 0000:04:00.4 failed to suspend async: error -110
Takashi Iwai 4c7831
Takashi Iwai 4c7831
Similar to commit ac343366846a ("xhci: Increase STS_SAVE timeout in
Takashi Iwai 4c7831
xhci_suspend()") we also need to increase the HALT timeout to make it be
Takashi Iwai 4c7831
able to suspend again.
Takashi Iwai 4c7831
Takashi Iwai 4c7831
Cc: <stable@vger.kernel.org> # 5.2+
Takashi Iwai 4c7831
Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
Takashi Iwai 4c7831
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Takashi Iwai 4c7831
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Takashi Iwai 4c7831
Link: https://lore.kernel.org/r/20191211142007.8847-5-mathias.nyman@linux.intel.com
Takashi Iwai 4c7831
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Takashi Iwai 4c7831
Acked-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 4c7831
Takashi Iwai 4c7831
---
Takashi Iwai 4c7831
 drivers/usb/host/xhci.c | 2 +-
Takashi Iwai 4c7831
 1 file changed, 1 insertion(+), 1 deletion(-)
Takashi Iwai 4c7831
Takashi Iwai 4c7831
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
Takashi Iwai 4c7831
index c5ee562c4c74..dbac0fa9748d 100644
Takashi Iwai 4c7831
--- a/drivers/usb/host/xhci.c
Takashi Iwai 4c7831
+++ b/drivers/usb/host/xhci.c
Takashi Iwai 4c7831
@@ -970,7 +970,7 @@ static bool xhci_pending_portevent(struct xhci_hcd *xhci)
Takashi Iwai 4c7831
 int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
Takashi Iwai 4c7831
 {
Takashi Iwai 4c7831
 	int			rc = 0;
Takashi Iwai 4c7831
-	unsigned int		delay = XHCI_MAX_HALT_USEC;
Takashi Iwai 4c7831
+	unsigned int		delay = XHCI_MAX_HALT_USEC * 2;
Takashi Iwai 4c7831
 	struct usb_hcd		*hcd = xhci_to_hcd(xhci);
Takashi Iwai 4c7831
 	u32			command;
Takashi Iwai 4c7831
 	u32			res;
Takashi Iwai 4c7831
-- 
Takashi Iwai 4c7831
2.16.4
Takashi Iwai 4c7831