linux-stable/drivers/usb/host
Mathias Nyman d6169d0409 xhci: fix deadlock at host remove by running watchdog correctly
If a URB is killed while the host is removed we can end up in a situation
where the hub thread takes the roothub device lock, and waits for
the URB to be given back by xhci-hcd, blocking the host remove code.

xhci-hcd tries to stop the endpoint and give back the urb, but can't
as the host is removed from PCI bus at the same time, preventing the normal
way of giving back urb.

Instead we need to rely on the stop command timeout function to give back
the urb. This xhci_stop_endpoint_command_watchdog() timeout function
used a XHCI_STATE_DYING flag to indicate if the timeout function is already
running, but later this flag has been taking into use in other places to
mark that xhci is dying.

Remove checks for XHCI_STATE_DYING in xhci_urb_dequeue. We are still
checking that reading from pci state does not return 0xffffffff or that
host is not halted before trying to stop the endpoint.

This whole area of stopping endpoints, giving back URBs, and the wathdog
timeout need rework, this fix focuses on solving a specific deadlock
issue that we can then send to stable before any major rework.

Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-11 16:52:13 +01:00
..
whci whci: Remove deprecated create_singlethread_workqueue 2016-08-15 16:25:58 +02:00
bcma-hcd.c USB: bcma: drop Northstar PHY 2.0 initialization code 2016-09-27 12:20:17 +02:00
ehci-atmel.c
ehci-dbg.c
ehci-exynos.c
ehci-fsl.c fsl/usb: Workarourd for USB erratum-A005697 2016-12-05 15:13:58 +01:00
ehci-fsl.h
ehci-grlib.c
ehci-hcd.c USB: host: ehci-sead3: Remove SEAD-3 EHCI code 2016-10-05 01:31:20 +02:00
ehci-hub.c fsl/usb: Workarourd for USB erratum-A005697 2016-12-05 15:13:58 +01:00
ehci-mem.c
ehci-msm.c usb: host: ehci-msm: Conditionally call ehci suspend/resume 2016-06-07 22:15:25 -07:00
ehci-mv.c
ehci-mxc.c
ehci-omap.c
ehci-orion.c
ehci-pci.c USB: EHCI: merge all cases that disable the IO watchdog 2016-10-24 14:36:25 +02:00
ehci-platform.c usb: ehci-platform: increase EHCI_MAX_RSTS to 4 2016-10-24 14:29:08 +02:00
ehci-pmcmsp.c
ehci-ppc-of.c
ehci-ps3.c
ehci-q.c usb: host: ehci: remove unnecessary max_packet() macro 2016-11-03 10:38:24 +02:00
ehci-sched.c usb: host: ehci: remove unnecessary max_packet() macro 2016-11-03 10:38:24 +02:00
ehci-sh.c
ehci-spear.c
ehci-st.c usb: host: ehci-st: Inform the reset framework that our reset line may be shared 2016-06-30 07:44:21 +01:00
ehci-sysfs.c
ehci-tegra.c usb: host: ehci-tegra: Avoid getting the same reset twice 2016-06-07 22:15:25 -07:00
ehci-tilegx.c
ehci-timer.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
ehci-w90x900.c USB: EHCI: ehci-w90x900: remove unuseful functions 2016-11-29 17:36:43 +01:00
ehci-xilinx-of.c
ehci.h fsl/usb: Workarourd for USB erratum-A005697 2016-12-05 15:13:58 +01:00
fhci-dbg.c
fhci-hcd.c usb: host: fhci-hcd: don't print on ENOMEM 2016-08-30 19:17:37 +02:00
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h
fotg210-hcd.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
fotg210.h
fsl-mph-dr-of.c fsl/usb: Workarourd for USB erratum-A005697 2016-12-05 15:13:58 +01:00
hwa-hc.c
imx21-dbg.c
imx21-hcd.c
imx21-hcd.h
isp116x-hcd.c
isp116x.h
isp1362-hcd.c usb: Convert pr_warning to pr_warn 2016-11-03 10:38:36 +02:00
isp1362.h
Kconfig USB: OHCI: make ohci-da8xx a separate driver 2016-10-27 16:59:59 +02:00
Makefile USB: OHCI: make ohci-da8xx a separate driver 2016-10-27 16:59:59 +02:00
max3421-hcd.c usb: host: max3421-hcd: don't print on ENOMEM 2016-08-30 19:17:37 +02:00
ohci-at91.c usb: ohci-at91: use descriptor-based gpio APIs correctly 2017-01-05 19:32:29 +01:00
ohci-da8xx.c USB: ohci: da8xx: Resume the entire host controller 2016-11-29 17:31:36 +01:00
ohci-dbg.c
ohci-exynos.c
ohci-hcd.c Merge 4.9-rc3 into usb-next 2016-10-30 06:40:39 -04:00
ohci-hub.c
ohci-mem.c USB: OHCI: use dma_pool_zalloc 2016-11-21 17:33:40 +01:00
ohci-nxp.c USB: OHCI: nxp: fix code warnings 2016-12-08 17:50:09 +01:00
ohci-omap.c USB: OHCI: omap: remove useless extern declaration 2016-12-05 16:32:51 +01:00
ohci-omap3.c
ohci-pci.c
ohci-platform.c ohci-platform: Add support for controllers with multiple reset lines 2016-06-07 22:21:41 -07:00
ohci-ppc-of.c
ohci-ps3.c
ohci-pxa27x.c USB: OHCI: ohci-pxa27x: remove useless functions 2016-12-05 16:32:51 +01:00
ohci-q.c USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails 2016-06-07 22:15:25 -07:00
ohci-s3c2410.c USB: OHCI: ohci-s3c2410: remove useless functions 2016-12-05 16:32:51 +01:00
ohci-sa1111.c usb: ohci-sa1111: remove mach/hardware.h include 2016-08-30 19:24:59 +02:00
ohci-sm501.c
ohci-spear.c
ohci-st.c usb: host: ohci-st: Inform the reset framework that our reset line may be shared 2016-06-30 07:44:20 +01:00
ohci-tilegx.c
ohci-tmio.c
ohci.h
oxu210hp-hcd.c
oxu210hp.h
pci-quirks.c drivers/usb: Skip auto handoff for TI and RENESAS usb controllers 2016-11-07 10:12:22 +01:00
pci-quirks.h
r8a66597-hcd.c
r8a66597.h
sl811-hcd.c
sl811.h
sl811_cs.c
ssb-hcd.c
u132-hcd.c
uhci-debug.c
uhci-grlib.c
uhci-hcd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
uhci-hcd.h
uhci-hub.c
uhci-pci.c USB: UHCI: report non-PME wakeup signalling for Intel hardware 2016-11-11 16:32:35 -06:00
uhci-platform.c
uhci-q.c
xhci-dbg.c
xhci-ext-caps.h
xhci-hub.c xhci: use default USB_RESUME_TIMEOUT when resuming ports. 2016-10-20 17:54:55 +02:00
xhci-mem.c xhci: Fix race related to abort operation 2017-01-03 17:37:32 +01:00
xhci-mtk-sch.c usb: host: xhci: purge GET_MAX_PACKET() 2016-11-03 10:38:22 +02:00
xhci-mtk.c usb: return error code when platform_get_irq fails 2017-01-03 17:37:32 +01:00
xhci-mtk.h usb: xhci-mtk: make IPPC register optional 2016-10-27 17:02:41 +02:00
xhci-mvebu.c
xhci-mvebu.h
xhci-pci.c usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake 2017-01-03 17:37:32 +01:00
xhci-plat.c usb: host: xhci: plat: add support for Renesas r8a7796 SoC 2016-11-14 10:18:22 +01:00
xhci-plat.h
xhci-rcar.c usb: host: xhci: plat: add support for Renesas r8a7796 SoC 2016-11-14 10:18:22 +01:00
xhci-rcar.h usb: host: xhci: rcar: add a new firmware version for r8a7796 2016-11-14 10:18:22 +01:00
xhci-ring.c xhci: fix deadlock at host remove by running watchdog correctly 2017-01-11 16:52:13 +01:00
xhci-tegra.c usb: host: xhci-tegra: Fix error return code in tegra_xusb_probe() 2016-09-13 17:24:24 +02:00
xhci-trace.c
xhci-trace.h
xhci.c xhci: fix deadlock at host remove by running watchdog correctly 2017-01-11 16:52:13 +01:00
xhci.h xhci: Fix race related to abort operation 2017-01-03 17:37:32 +01:00