linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend()
@ 2019-11-04  5:52 Kai-Heng Feng
  2019-11-22 16:36 ` Kai-Heng Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2019-11-04  5:52 UTC (permalink / raw)
  To: mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel, Kai-Heng Feng

I've recently observed failed xHCI suspend attempt on AMD Raven Ridge
system:
kernel: xhci_hcd 0000:04:00.4: WARN: xHC CMD_RUN timeout
kernel: PM: suspend_common(): xhci_pci_suspend+0x0/0xd0 returns -110
kernel: PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -110
kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -110
kernel: PM: Device 0000:04:00.4 failed to suspend async: error -110

Similar to commit ac343366846a ("xhci: Increase STS_SAVE timeout in
xhci_suspend()") we also need to increase the HALT timeout to make it be
able to suspend again.

Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.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 6c17e3fe181a..53720c41891a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -973,7 +973,7 @@ static bool xhci_pending_portevent(struct xhci_hcd *xhci)
 int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 {
 	int			rc = 0;
-	unsigned int		delay = XHCI_MAX_HALT_USEC;
+	unsigned int		delay = XHCI_MAX_HALT_USEC * 2;
 	struct usb_hcd		*hcd = xhci_to_hcd(xhci);
 	u32			command;
 	u32			res;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend()
  2019-11-04  5:52 [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend() Kai-Heng Feng
@ 2019-11-22 16:36 ` Kai-Heng Feng
  2019-11-22 16:54   ` Mathias Nyman
  0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2019-11-22 16:36 UTC (permalink / raw)
  To: Mathias Nyman, Greg KH
  Cc: Atroshko, Yevhen, USB list, Kernel development list

Hi Matthias,

> On Nov 4, 2019, at 13:52, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
> 
> I've recently observed failed xHCI suspend attempt on AMD Raven Ridge
> system:
> kernel: xhci_hcd 0000:04:00.4: WARN: xHC CMD_RUN timeout
> kernel: PM: suspend_common(): xhci_pci_suspend+0x0/0xd0 returns -110
> kernel: PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -110
> kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -110
> kernel: PM: Device 0000:04:00.4 failed to suspend async: error -110
> 
> Similar to commit ac343366846a ("xhci: Increase STS_SAVE timeout in
> xhci_suspend()") we also need to increase the HALT timeout to make it be
> able to suspend again.

Seems like there are more broken AMD xHCI in the wild, so please merge this patch if there's no further concerns.

Kai-Heng

> 
> Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.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 6c17e3fe181a..53720c41891a 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -973,7 +973,7 @@ static bool xhci_pending_portevent(struct xhci_hcd *xhci)
> int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
> {
> 	int			rc = 0;
> -	unsigned int		delay = XHCI_MAX_HALT_USEC;
> +	unsigned int		delay = XHCI_MAX_HALT_USEC * 2;
> 	struct usb_hcd		*hcd = xhci_to_hcd(xhci);
> 	u32			command;
> 	u32			res;
> -- 
> 2.17.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend()
  2019-11-22 16:36 ` Kai-Heng Feng
@ 2019-11-22 16:54   ` Mathias Nyman
  0 siblings, 0 replies; 3+ messages in thread
From: Mathias Nyman @ 2019-11-22 16:54 UTC (permalink / raw)
  To: Kai-Heng Feng, Mathias Nyman, Greg KH
  Cc: Atroshko, Yevhen, USB list, Kernel development list

On 22.11.2019 18.36, Kai-Heng Feng wrote:
> Hi Matthias,
> 
>> On Nov 4, 2019, at 13:52, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
>>
>> I've recently observed failed xHCI suspend attempt on AMD Raven Ridge
>> system:
>> kernel: xhci_hcd 0000:04:00.4: WARN: xHC CMD_RUN timeout
>> kernel: PM: suspend_common(): xhci_pci_suspend+0x0/0xd0 returns -110
>> kernel: PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -110
>> kernel: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -110
>> kernel: PM: Device 0000:04:00.4 failed to suspend async: error -110
>>
>> Similar to commit ac343366846a ("xhci: Increase STS_SAVE timeout in
>> xhci_suspend()") we also need to increase the HALT timeout to make it be
>> able to suspend again.
> 
> Seems like there are more broken AMD xHCI in the wild, so please merge this patch if there's no further concerns.
> 
> Kai-Heng

Added to queue,

-Mathias

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-22 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04  5:52 [PATCH] xhci: Increase STS_HALT timeout in xhci_suspend() Kai-Heng Feng
2019-11-22 16:36 ` Kai-Heng Feng
2019-11-22 16:54   ` Mathias Nyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).