linux/drivers/usb/dwc3
Grygorii Strashko 8af0937aee usb: dwc3: omap: fix race of pm runtime with irq handler in probe
[ Upstream commit 12a7f17fac ]

Now races can happen between interrupt handler execution and PM runtime in
error handling code path in probe and in dwc3_omap_remove() which will lead
to system crash:

in probe:
...
 err1:
	pm_runtime_put_sync(dev);
^^ PM runtime can race with IRQ handler when deferred probing happening
   due to extcon
	pm_runtime_disable(dev);

	return ret;

in dwc3_omap_remove:
...
	dwc3_omap_disable_irqs(omap);
^^ IRQs are disabled in HW, but handler may still run
	of_platform_depopulate(omap->dev);
	pm_runtime_put_sync(&pdev->dev);
^^ PM runtime can race with IRQ handler
	pm_runtime_disable(&pdev->dev);

	return 0;

So, OMAP DWC3 IRQ need to be disabled before calling
pm_runtime_put() in probe and in dwc3_omap_remove().

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-08-06 18:59:46 -07:00
..
core.c usb: dwc3: Fix error handling for core init 2016-10-31 11:14:27 +02:00
core.h usb: dwc3: gadget: Fix full speed mode 2017-01-12 11:39:18 +01:00
debug.c usb: dwc3: add tracepoints to aid debugging 2014-09-05 09:55:51 -05:00
debug.h usb: dwc3: debug: fix ep name on trace output 2016-08-25 10:36:25 +03:00
debugfs.c usb: dwc3: add DWC3_GUCTL1 reg for debug 2016-06-20 12:32:46 +03:00
dwc3-exynos.c usb: dwc3: exynos fix axius clock error path to do cleanup 2017-06-24 07:11:17 +02:00
dwc3-keystone.c usb: dwc3: keystone: drop dma_mask configuration 2016-04-06 16:36:01 +03:00
dwc3-of-simple.c usb: dwc3: of-simple: add compatible for Cavium 2016-09-13 09:28:59 +03:00
dwc3-omap.c usb: dwc3: omap: fix race of pm runtime with irq handler in probe 2017-08-06 18:59:46 -07:00
dwc3-pci.c usb: dwc3: pci: Fix dr_mode misspelling 2017-01-12 11:39:17 +01:00
dwc3-st.c usb: dwc3: replace %p with %pK 2017-07-12 15:01:03 +02:00
ep0.c usb: dwc3: ep0: explicitly call dwc3_ep0_prepare_one_trb() 2017-01-12 11:39:22 +01:00
gadget.c usb: dwc3: replace %p with %pK 2017-07-12 15:01:03 +02:00
gadget.h usb: dwc3: gadget: make Set Endpoint Configuration macros safe 2017-03-18 19:14:31 +08:00
host.c usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions 2017-04-12 12:41:19 +02:00
io.h usb: dwc3: gadget: add a pointer to endpoint registers 2016-06-20 12:32:35 +03:00
Kconfig usb: remove redundant dependency on USB_SUPPORT 2016-08-09 16:15:44 +02:00
Makefile usb: dwc3: remove dwc3-qcom in favor of dwc3-of-simple 2015-12-15 09:12:41 -06:00
trace.c usb: dwc3: add tracepoints to aid debugging 2014-09-05 09:55:51 -05:00
trace.h usb: dwc3: gadget: keep track of allocated and queued reqs 2016-06-20 12:32:49 +03:00
ulpi.c usb: dwc3: ulpi: make dwc3_ulpi_ops constant 2016-09-06 10:47:26 +03:00