diff mbox series

[7/8] xhci: Increase STS_SAVE timeout in xhci_suspend()

Message ID 1570190373-30684-8-git-send-email-mathias.nyman@linux.intel.com (mailing list archive)
State Superseded
Commit ac343366846a445bb81f0a0e8f16abb8bd5d5d88
Headers show
Series xhci fixes for usb-linus | expand

Commit Message

Mathias Nyman Oct. 4, 2019, 11:59 a.m. UTC
From: Kai-Heng Feng <kai.heng.feng@canonical.com>

After commit f7fac17ca925 ("xhci: Convert xhci_handshake() to use
readl_poll_timeout_atomic()"), ASMedia xHCI may fail to suspend.

Although the algorithms are essentially the same, the old max timeout is
(usec + usec * time of doing readl()), and the new max timeout is just
usec, which is much less than the old one.

Increase the timeout to make ASMedia xHCI able to suspend again.

BugLink: https://bugs.launchpad.net/bugs/1844021
Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
Cc: <stable@vger.kernel.org> # v5.2+
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kai-Heng Feng Oct. 7, 2019, 6:51 p.m. UTC | #1
Hi Sasha,

> On Oct 6, 2019, at 20:07, Sasha Levin <sashal@kernel.org> wrote:
> 
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: f7fac17ca925 xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic().
> 
> The bot has tested the following trees: v5.3.2, v5.2.18, v4.19.76, v4.14.146, v4.9.194, v4.4.194.
> 
> v5.3.2: Build OK!
> v5.2.18: Build OK!
> v4.19.76: Build OK!
> v4.14.146: Build OK!
> v4.9.194: Failed to apply! Possible dependencies:
>    0b6c324c8b60 ("xhci: cleanup and refactor process_ctrl_td()")
>    0f1d832ed1fb ("usb: xhci: Add port test modes support for usb2.")
>    11644a765952 ("xhci: Add quirk to workaround the errata seen on Cavium Thunder-X2 Soc")
>    191edc5e2e51 ("xhci: Fix front USB ports on ASUS PRIME B350M-A")
>    1cc6d8617b91 ("usb: xhci: remove unnecessary second abort try")
>    2a72126de1bb ("xhci: Remove duplicate xhci urb giveback functions")
>    2d6d5769f82d ("xhci: fix non static symbol warning")
>    30a65b45bfb1 ("xhci: cleanup and refactor process_bulk_intr_td()")
>    446b31419cb1 ("xhci: refactor handle_tx_event() urb giveback")
>    4750bc78efdb ("usb: host: xhci support option to disable the xHCI USB2 HW LPM")
>    488dc164914f ("xhci: remove WARN_ON if dma mask is not set for platform devices")
>    4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration")
>    505f581c48bc ("xhci: simplify if statement to make it more readable")
>    52ab86852f74 ("xhci: remove extra URB_SHORT_NOT_OK checks in xhci, core handles most cases")
>    6b7f40f71234 ("xhci: change xhci_set_link_state() to work with port structures")
>    76a35293b901 ("usb: host: xhci: simplify irq handler return")
>    9983a5fc39bf ("xhci: rename EP_HALT_PENDING to EP_STOP_CMD_PENDING")
>    9ef7fbbb4fdf ("xhci: Rename variables related to transfer descritpors")
>    a6ff6cbf1fab ("usb: xhci: Add helper function xhci_set_power_on().")
>    a7d57abcc8a5 ("xhci: workaround CSS timeout on AMD SNPS 3.0 xHC")
>    d3519b9d9606 ("xhci: Manually give back cancelled URB if we can't queue it for cancel")
>    d9f11ba9f107 ("xhci: Rework how we handle unresponsive or hoptlug removed hosts")
>    e740b019d7c6 ("xhci: xhci-hub: use new port structures to get port address instead of port array")
>    eaefcf246b56 ("xhci: change xhci_test_and_clear_bit() to use new port structure")
>    f97c08ae329b ("xhci: rename endpoint related trb variables")
>    f99265965b32 ("xhci: detect stop endpoint race using pending timer instead of counter.")
>    ffd4b4fc0b9a ("xhci: Add helper to get xhci roothub from hcd")
> 
> v4.4.194: Failed to apply! Possible dependencies:
>    11644a765952 ("xhci: Add quirk to workaround the errata seen on Cavium Thunder-X2 Soc")
>    191edc5e2e51 ("xhci: Fix front USB ports on ASUS PRIME B350M-A")
>    21939f003ad0 ("usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested")
>    41135de1e7fd ("usb: xhci: add quirk flag for broken PED bits")
>    4750bc78efdb ("usb: host: xhci support option to disable the xHCI USB2 HW LPM")
>    488dc164914f ("xhci: remove WARN_ON if dma mask is not set for platform devices")
>    4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration")
>    4efb2f694114 ("usb: host: xhci-plat: add struct xhci_plat_priv")
>    69307ccb9ad7 ("usb: xhci: bInterval quirk for TI TUSB73x0")
>    76f9502fe761 ("xhci: plat: adapt to unified device property interface")
>    9da5a1092b13 ("xhci: Bad Ethernet performance plugged in ASM1042A host")
>    a3aef3793071 ("xhci: get rid of platform data")
>    a7d57abcc8a5 ("xhci: workaround CSS timeout on AMD SNPS 3.0 xHC")
>    dec08194ffec ("xhci: Limit USB2 port wake support for AMD Promontory hosts")
>    def4e6f7b419 ("xhci: refactor and cleanup endpoint initialization.")
> 
> 
> NOTE: The patch will not be queued to stable trees until it is upstream.

Where do I send backport for v4.4 and v4.9?

Kai-Heng

> 
> How should we proceed with this patch?
> 
> -- 
> Thanks,
> Sasha
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 8c068d0cc7c1..00f3804f7aa7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1032,7 +1032,7 @@  int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 	writel(command, &xhci->op_regs->command);
 	xhci->broken_suspend = 0;
 	if (xhci_handshake(&xhci->op_regs->status,
-				STS_SAVE, 0, 10 * 1000)) {
+				STS_SAVE, 0, 20 * 1000)) {
 	/*
 	 * AMD SNPS xHC 3.0 occasionally does not clear the
 	 * SSS bit of USBSTS and when driver tries to poll