]> git.ipfire.org Git - people/arne_f/kernel.git/commit
usb: dwc3: Fix lock-up on ID change during system suspend/resume
authorRoger Quadros <rogerq@ti.com>
Tue, 27 Feb 2018 10:41:41 +0000 (12:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:46 +0000 (08:42 +0100)
commite52fb772cb1da00d117da821ebabffe79862c25b
tree56c04a314a76f37774787d28e6692251d8077c46
parent99d7fb05c1e91c1585b2ee922e79a1d46f7d3380
usb: dwc3: Fix lock-up on ID change during system suspend/resume

commit 084a804e01205bcd74cd0849bc72cb5c88f8e648 upstream.

To reproduce the lock up do the following
- connect otg host adapter and a USB device to the dual-role port
so that it is in host mode.
- suspend to mem.
- disconnect otg adapter.
- resume the system.

If we call dwc3_host_exit() before tasks are thawed
xhci_plat_remove() seems to lock up at the second usb_remove_hcd() call.

To work around this we queue the _dwc3_set_mode() work on
the system_freezable_wq.

Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly")
Cc: <stable@vger.kernel.org> # v4.12+
Suggested-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.c