linux/drivers/usb/host
Mathias Nyman a3a3b6c71e xhci: Don't let USB3 ports stuck in polling state prevent suspend
commit d92f2c59cc upstream.

Commit 2f31a67f01 ("usb: xhci: Prevent bus suspend if a port connect
change or polling state is detected") was intended to prevent ports that
were still link training from being forced to U3 suspend state mid
enumeration.
This solved enumeration issues for devices with slow link training.

Turns out some devices are stuck in the link training/polling state,
and thus that patch will prevent suspend completely for these devices.
This is seen with USB3 card readers in some MacBooks.

Instead of preventing suspend, give some time to complete the link
training. On successful training the port will end up as connected
and enabled.
If port instead is stuck in link training the bus suspend will continue
suspending after 360ms (10 * 36ms) timeout (tPollingLFPSTimeout).

Original patch was sent to stable, this one should go there as well

Fixes: 2f31a67f01 ("usb: xhci: Prevent bus suspend if a port connect change or polling state is detected")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-08-13 12:38:52 +01:00
..
whci USB: whci-hcd: add check for dma mapping error 2016-01-11 10:50:17 +00:00
bcma-hcd.c DMA-API: usb: bcma: replace dma_set_mask()+dma_set_coherent_mask() with new helper 2013-10-31 14:48:34 +00:00
ehci-atmel.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-dbg.c usb: host: fix incorrect updating of offset 2018-03-03 15:51:35 +00:00
ehci-exynos.c usb: host: ehci-exynos: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ehci-fsl.c drivers: usb: fsl: Workaround for USB erratum-A005275 2015-10-28 10:33:15 +00:00
ehci-fsl.h powerpc/usb: fix bug of CPU hang when missing USB PHY clock 2012-09-05 16:52:08 -07:00
ehci-grlib.c USB: ehci-grlib: use dev_err() instead of printk() 2013-12-18 16:32:41 -08:00
ehci-hcd.c usb: host: ehci: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:45 +01:00
ehci-hub.c drivers: usb: fsl: Workaround for USB erratum-A005275 2015-10-28 10:33:15 +00:00
ehci-mem.c USB: EHCI: fix sparse errors 2013-10-19 14:08:04 -07:00
ehci-msm.c usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ehci-mv.c usb: host: ehci-mv: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ehci-mxc.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-octeon.c USB: ehci-octeon: Use devm_ioremap_resource() 2013-12-18 16:34:20 -08:00
ehci-omap.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-orion.c usb: ehci-orion: fix probe for !GENERIC_PHY 2015-12-13 17:49:29 +00:00
ehci-pci.c USB: ehci-pci: USB host controller support for Intel Quark X1000 2014-09-05 16:36:25 -07:00
ehci-platform.c usb: ehci-platform: add optional reset controller retrieval 2014-05-27 15:53:01 -07:00
ehci-pmcmsp.c MIPS: MSP71xx: Remove checks for two macros 2014-05-23 15:12:39 +02:00
ehci-ppc-of.c USB: ehci-ppc-of: use dev_err() instead of printk() 2013-12-18 16:32:41 -08:00
ehci-ps3.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-q.c usb: kill DEBUG compile option 2013-12-03 10:34:33 -08:00
ehci-sched.c USB: EHCI: fix initialization bug in iso_stream_schedule() 2015-01-22 16:33:19 +00:00
ehci-sead3.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-sh.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ehci-spear.c usb: host: ehci-spear: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ehci-sysfs.c usb: host: ehci-sys: delete useless bus_to_hcd conversion 2015-09-28 10:21:43 +01:00
ehci-tegra.c usb: host: ehci-tegra: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ehci-tilegx.c tile: usb: Use irq_alloc/free_hwirq 2014-05-16 14:05:20 +02:00
ehci-timer.c USB: EHCI: improve interrupt qh unlink 2013-08-12 11:43:48 -07:00
ehci-w90x900.c USB: ehci-w90x900: Use devm_ioremap_resource() 2013-12-18 16:35:11 -08:00
ehci-xilinx-of.c USB: ehci-xilinx-of: use dev_err() instead of printk() 2013-12-18 16:32:41 -08:00
ehci.h drivers: usb: fsl: Workaround for USB erratum-A005275 2015-10-28 10:33:15 +00:00
fhci-dbg.c USB: FHCI: Reusing QUICC Engine USB Controller registers from immap_qe.h 2012-06-26 19:42:11 -07:00
fhci-hcd.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
fhci-hub.c USB: FHCI: Reusing QUICC Engine USB Controller registers from immap_qe.h 2012-06-26 19:42:11 -07:00
fhci-mem.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-q.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
fhci-sched.c USB: FHCI: upgrade the isochronous API 2013-05-30 21:34:31 +09:00
fhci-tds.c USB: FHCI: Reusing QUICC Engine USB Controller registers from immap_qe.h 2012-06-26 19:42:11 -07:00
fhci.h USB: FHCI: upgrade the isochronous API 2013-05-30 21:34:31 +09:00
fotg210-hcd.c usb: host: fotg210: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:47 +01:00
fotg210.h fotg210: remove conditional compilation 2013-12-03 10:28:39 -08:00
fsl-mph-dr-of.c drivers: usb: fsl: Workaround for USB erratum-A005275 2015-10-28 10:33:15 +00:00
fusbh200-hcd.c usb: host: fusbh200: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:47 +01:00
fusbh200.h fusb200h: always compile in debugfs support 2013-12-03 10:31:21 -08:00
hwa-hc.c USB: check usb_get_extra_descriptor for proper size 2019-02-11 17:54:20 +00:00
imx21-dbg.c usb: kill DEBUG compile option 2013-12-03 10:34:33 -08:00
imx21-hcd.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
imx21-hcd.h usb: kill DEBUG compile option 2013-12-03 10:34:33 -08:00
isp116x-hcd.c usb: host: isp116x: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:46 +01:00
isp116x.h USB: isp116x: remove dependency on CONFIG_USB_DEBUG 2013-07-23 16:35:17 -07:00
isp1362-hcd.c usb: delete non-required instances of include <linux/init.h> 2014-01-08 15:01:39 -08:00
isp1362.h USB: isp1362: move debug files from proc to debugfs 2013-07-24 14:43:05 -07:00
isp1760-hcd.c usb: isp1760: hcd: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:50 +01:00
isp1760-hcd.h usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. 2011-10-19 13:29:06 -07:00
isp1760-if.c USB: host: use dev_get_platdata() 2013-07-31 17:53:50 -07:00
Kconfig usb: Kconfig: make EHCI_MSM selectable for QCOM SOCs 2014-06-30 22:47:18 -07:00
Makefile usb: host: xhci-plat: add support for the Armada 375/38x XHCI controllers 2014-05-27 15:40:40 -07:00
max3421-hcd.c usb: host: max3421-hcd: Use module_spi_driver 2014-05-29 11:19:30 -07:00
octeon2-common.c usb: Configure octeon2 glue logic for proper uSOF cycle period. 2011-05-03 10:09:32 -07:00
ohci-at91.c USB: OHCI: Export the OHCI hub control and status_data functions 2014-04-24 13:05:32 -07:00
ohci-da8xx.c USB: ohci-da8xx: Use devm_*() functions 2013-12-18 16:35:11 -08:00
ohci-dbg.c USB: OHCI: fix bugs in debug routines 2014-09-05 16:36:24 -07:00
ohci-exynos.c usb: host: ohci-exynos: Use devm_ioremap_resource instead of devm_ioremap 2014-05-27 14:52:29 -07:00
ohci-hcd.c USB: OHCI: fix bugs in debug routines 2014-09-05 16:36:24 -07:00
ohci-hub.c Merge 3.15-rc5 into usb-next 2014-05-20 09:49:41 +09:00
ohci-jz4740.c USB: ohci-jz4740: FEAT_POWER is a port feature, not a hub feature 2014-04-16 13:59:41 -07:00
ohci-mem.c USB: OHCI handles more ZFMicro quirks 2007-10-12 14:54:59 -07:00
ohci-nxp.c USB: ohci-nxp: Use devm_clk_get() 2013-12-18 16:36:10 -08:00
ohci-octeon.c USB: ohci-octeon: Use devm_ioremap_resource() 2013-12-18 16:36:11 -08:00
ohci-omap.c USB: ohci-omap: use dev_err() instead of printk() 2013-12-18 16:32:41 -08:00
ohci-omap3.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ohci-pci.c USB: OHCI: fix problem with global suspend on ATI controllers 2014-05-03 17:58:46 -04:00
ohci-platform.c usb: ohci-platform: Enable optional use of reset controller 2014-05-27 15:53:00 -07:00
ohci-ppc-of.c USB: ohci-ppc-of: Use devm_ioremap_resource() 2013-12-18 16:36:10 -08:00
ohci-ps3.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ohci-pxa27x.c USB: ohci-pxa27x: Add support for external vbus regulators 2014-04-24 13:05:32 -07:00
ohci-q.c usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks() 2018-06-16 22:22:16 +01:00
ohci-s3c2410.c USB: OHCI: Export the OHCI hub control and status_data functions 2014-04-24 13:05:32 -07:00
ohci-sa1111.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ohci-sm501.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
ohci-spear.c USB: ohci-spear: Use devm_ioremap_resource() 2013-12-18 16:36:11 -08:00
ohci-tilegx.c tile: usb: Use irq_alloc/free_hwirq 2014-05-16 14:05:20 +02:00
ohci-tmio.c usb: delete non-required instances of include <linux/init.h> 2014-01-08 15:01:39 -08:00
ohci.h Merge 3.15-rc5 into usb-next 2014-05-20 09:49:41 +09:00
oxu210hp-hcd.c usb: host: oxu210hp: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:48 +01:00
oxu210hp.h USB: replace uses of __constant_{endian} 2009-03-24 16:20:33 -07:00
pci-quirks.c usb: pci-quirks.c: Corrected timeout values used in handshake 2018-01-01 20:51:32 +00:00
pci-quirks.h xhci: Bad Ethernet performance plugged in ASM1042A host 2017-11-11 13:33:02 +00:00
r8a66597-hcd.c usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable() 2019-04-04 16:13:58 +01:00
r8a66597.h usb/host/r8a66597: remove conditional compilation of clk code 2012-07-30 17:25:12 -07:00
sl811-hcd.c usb: host: sl811: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:49 +01:00
sl811.h USB: sl811: move debug files from proc to debugfs 2013-07-24 14:43:05 -07:00
sl811_cs.c usb: delete non-required instances of include <linux/init.h> 2014-01-08 15:01:39 -08:00
ssb-hcd.c DMA-API: usb: ssb-hcd: replace dma_set_mask()+dma_set_coherent_mask() with new helper 2013-10-31 14:48:36 +00:00
u132-hcd.c usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame() 2018-12-16 22:09:08 +00:00
uhci-debug.c usb: kill DEBUG compile option 2013-12-03 10:34:33 -08:00
uhci-grlib.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
uhci-hcd.c usb: kill DEBUG compile option 2013-12-03 10:34:33 -08:00
uhci-hcd.h USB: UHCI: remove unused definition 2013-01-24 13:42:09 -08:00
uhci-hub.c usb: host: uhci: use new USB_RESUME_TIMEOUT 2015-05-05 11:09:45 +01:00
uhci-pci.c USB: UHCI: report non-PME wakeup signalling for Intel hardware 2017-03-16 02:26:19 +00:00
uhci-platform.c uhci-platform: Change compatible string from platform-uhci to generic-uhci 2014-02-15 12:25:51 -08:00
uhci-q.c USB: UHCI: accept very late isochronous URBs 2013-09-25 17:05:34 -07:00
xhci-dbg.c Revert "xhci: replace xhci_read_64() with readq()" 2014-01-30 13:27:49 -08:00
xhci-ext-caps.h xhci: fix port BESL LPM capability checking 2013-08-27 08:54:42 -07:00
xhci-hub.c xhci: Don't let USB3 ports stuck in polling state prevent suspend 2019-08-13 12:38:52 +01:00
xhci-mem.c xhci: xhci-mem: off by one in xhci_stream_id_to_ring() 2018-11-20 18:05:37 +00:00
xhci-mvebu.c usb: host: xhci-plat: add support for the Armada 375/38x XHCI controllers 2014-05-27 15:40:40 -07:00
xhci-mvebu.h usb: host: xhci-plat: add support for the Armada 375/38x XHCI controllers 2014-05-27 15:40:40 -07:00
xhci-pci.c xhci: workaround CSS timeout on AMD SNPS 3.0 xHC 2019-02-11 17:54:21 +00:00
xhci-plat.c usb: host: xhci-plat: propagate return value of platform_get_irq() 2017-09-15 18:29:44 +01:00
xhci-ring.c usb: xhci: fix uninitialized completion when USB3 port got wrong status 2019-02-11 17:53:58 +00:00
xhci-trace.c xhci: add traces for debug messages in xhci_address_device() 2013-08-13 16:05:38 -07:00
xhci-trace.h xhci: fix sparse warning in xhci-trace.h 2013-12-02 12:59:45 -08:00
xhci.c xhci: Prevent U1/U2 link pm states if exit latency is too long 2019-02-11 17:54:21 +00:00
xhci.h xhci: Don't let USB3 ports stuck in polling state prevent suspend 2019-08-13 12:38:52 +01:00