linux_dsm_epyc7002/drivers/usb/host
Kai-Heng Feng b3d71abd13 xhci: Poll for U0 after disabling USB2 LPM
USB2 devices with LPM enabled may interrupt the system suspend:
[  932.510475] usb 1-7: usb suspend, wakeup 0
[  932.510549] hub 1-0:1.0: hub_suspend
[  932.510581] usb usb1: bus suspend, wakeup 0
[  932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended
[  932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended
..
[  932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03
..
[  932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
[  932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16
[  932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16

During system suspend, USB core will let HC suspends the device if it
doesn't have remote wakeup enabled and doesn't have any children.
However, from the log above we can see that the usb 1-7 doesn't get bus
suspended due to not in U0. After a while the port finished U2 -> U0
transition, interrupts the suspend process.

The observation is that after disabling LPM, port doesn't transit to U0
immediately and can linger in U2. xHCI spec 4.23.5.2 states that the
maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for
the affected device is advertised as 400us, which is still not enough
based on my testing result.

So let's use the maximum permitted latency, 10000, to poll for U0
status to solve the issue.

Cc: stable@vger.kernel.org
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-24 16:03:41 +02:00
..
bcma-hcd.c
ehci-atmel.c
ehci-brcm.c usb: ehci: Add new EHCI driver for Broadcom STB SoC's 2020-05-13 14:28:01 +02:00
ehci-dbg.c
ehci-exynos.c usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() 2020-06-18 10:40:57 +02:00
ehci-fsl.c
ehci-fsl.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
ehci-grlib.c
ehci-hcd.c
ehci-hub.c
ehci-mem.c
ehci-mv.c USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int 2020-05-19 15:11:43 +02:00
ehci-mxc.c USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() 2020-05-19 15:12:21 +02:00
ehci-npcm7xx.c
ehci-omap.c
ehci-orion.c
ehci-pci.c USB: ehci: reopen solution for Synopsys HC bug 2020-06-18 10:42:52 +02:00
ehci-platform.c usb/ehci-platform: Set PM runtime as active on resume 2020-05-18 18:15:40 +02:00
ehci-pmcmsp.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
ehci-ppc-of.c
ehci-ps3.c
ehci-q.c USB: EHCI: Do not return -EPIPE when hub is disconnected 2019-12-17 16:02:49 +01:00
ehci-sched.c
ehci-sh.c
ehci-spear.c
ehci-st.c
ehci-sysfs.c
ehci-tegra.c usb: host: ehci-tegra: Remove superfluous dev_err() message 2020-04-16 14:32:45 +02:00
ehci-timer.c
ehci-xilinx-of.c
ehci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
fhci-dbg.c
fhci-hcd.c usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough 2020-02-19 11:08:52 +01:00
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
fotg210-hcd.c
fotg210.h USB: Replace zero-length array with flexible-array member 2020-02-23 19:24:51 +01:00
fsl-mph-dr-of.c
imx21-dbg.c
imx21-hcd.c
imx21-hcd.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
isp116x-hcd.c
isp116x.h
isp1362-hcd.c
isp1362.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile usb: renesas-xhci: Add the renesas xhci driver 2020-05-15 15:44:35 +02:00
max3421-hcd.c
ohci-at91.c
ohci-da8xx.c usb: ohci-da8xx: ensure error return on variable error is set 2020-01-08 17:34:18 +01:00
ohci-dbg.c
ohci-exynos.c usb: exynos: Rename Samsung and Exynos to lowercase 2020-01-09 10:53:38 +01:00
ohci-hcd.c
ohci-hub.c
ohci-mem.c
ohci-nxp.c
ohci-omap.c
ohci-pci.c usb: hci: add hc_driver as argument for usb_hcd_pci_probe 2020-05-15 15:44:34 +02:00
ohci-platform.c usb/ohci-platform: Fix a warning when hibernating 2020-05-18 18:15:39 +02:00
ohci-ppc-of.c
ohci-ps3.c
ohci-pxa27x.c
ohci-q.c
ohci-s3c2410.c
ohci-sa1111.c
ohci-sm501.c USB: ohci-sm501: Add missed iounmap() in remove 2020-06-18 10:42:53 +02:00
ohci-spear.c
ohci-st.c
ohci-tmio.c
ohci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
oxu210hp-hcd.c usb: host: oxu210hp-hcd: fix gcc warning 2020-01-08 16:58:36 +01:00
pci-quirks.c USB/PHY driver updates for 5.8-rc1 2020-06-07 09:42:16 -07:00
pci-quirks.h
r8a66597-hcd.c
r8a66597.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
sl811_cs.c
sl811-hcd.c usb: host: sl811-hcd: remove useless cast for driver.name 2020-02-19 11:10:27 +01:00
sl811.h
ssb-hcd.c
u132-hcd.c usb: host: u132-hcd: Remove u132_static_list and list head u132_list 2020-04-16 14:32:46 +02:00
uhci-debug.c
uhci-grlib.c
uhci-hcd.c
uhci-hcd.h
uhci-hub.c
uhci-pci.c usb: hci: add hc_driver as argument for usb_hcd_pci_probe 2020-05-15 15:44:34 +02:00
uhci-platform.c
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c
xhci-dbgcap.h
xhci-dbgtty.c
xhci-debugfs.c
xhci-debugfs.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-ext-caps.c
xhci-ext-caps.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-histb.c usb: host: hisilicon: convert to devm_platform_get_and_ioremap_resource 2020-03-24 12:09:39 +01:00
xhci-hub.c xhci: prevent bus suspend if a roothub port detected a over-current condition 2020-04-21 16:27:38 +02:00
xhci-mem.c xhci: Wait until link state trainsits to U0 after setting USB_SS_PORT_LS_U0 2020-03-12 17:34:49 +01:00
xhci-mtk-sch.c
xhci-mtk.c usb: host: xhci-mtk: avoid runtime suspend when removing hcd 2020-06-24 16:03:41 +02:00
xhci-mtk.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-mvebu.c
xhci-mvebu.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-pci-renesas.c usb: renesas-xhci: include correct header for get_unaligned_le16() 2020-05-18 17:36:17 +02:00
xhci-pci.c usb: xhci: Add support for Renesas controller with memory 2020-05-15 15:44:35 +02:00
xhci-pci.h usb: xhci: make symbols static 2020-05-19 14:11:55 +02:00
xhci-plat.c usb/xhci-plat: Set PM runtime as active on resume 2020-05-18 18:15:40 +02:00
xhci-plat.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-rcar.c
xhci-rcar.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-ring.c usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list 2020-05-14 13:44:37 +02:00
xhci-tegra.c usb: xhci-tegra: Add OTG support 2020-03-19 14:18:57 +01:00
xhci-trace.c
xhci-trace.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci.c xhci: Poll for U0 after disabling USB2 LPM 2020-06-24 16:03:41 +02:00
xhci.h xhci: Fix incorrect EP_STATE_MASK 2020-06-24 16:03:41 +02:00