usb: xhci: clean up command queue when halting
Calling usb_remove_hcd() on both of the xHCI HCDs may race with
hub_event() which executes on its own workqueue. When xhci_halt()
is called and stops the command ring, the hub thread may have
already issued a command such as xhci_configure_endpoint() and
is currently waiting for the command to complete while holding
the device lock. Meanwhile since the controller is already halted,
no events are expected to complete and the command timer will
continually timeout every 5 seconds and re-arm itself. Since the
completion for the command is never issued, the threads are
essentially deadlocked.
Avoid this situation when halting the controller by forcing the
command queue to be cleaned up.
Change-Id: I88150e3435b5f06e37e9881dddaeff4807c24cc9
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment