Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a73ebe7 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: XHCI: Bailout command abort operation upon XHCI remove



As part of Command timeout handling command abort operation
is performed. This requires to poll for command ring status
for 5 second and a re-try for another 3 second. In case of
XHCI removal this can cause watch dog timeout because polling
is done with spin lock held. Fix this issue by calling
xhci_handshake_check_state() API which bails out the polling
upon XHCI removal.

Change-Id: I2d4c4654cb8909a3a71002870f1f5946d60f7d8f
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 93f5ce49
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -340,14 +340,14 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags)
	 * seconds), then it should assume that the there are
	 * larger problems with the xHC and assert HCRST.
	 */
	ret = xhci_handshake(&xhci->op_regs->cmd_ring,
	ret = xhci_handshake_check_state(xhci, &xhci->op_regs->cmd_ring,
			CMD_RING_RUNNING, 0, 5 * 1000 * 1000);
	if (ret < 0) {
		/* we are about to kill xhci, give it one more chance */
		xhci_write_64(xhci, temp_64 | CMD_RING_ABORT,
			      &xhci->op_regs->cmd_ring);
		udelay(1000);
		ret = xhci_handshake(&xhci->op_regs->cmd_ring,
		ret = xhci_handshake_check_state(xhci, &xhci->op_regs->cmd_ring,
				     CMD_RING_RUNNING, 0, 3 * 1000 * 1000);
		if (ret < 0) {
			xhci_err(xhci, "Stopped the command ring failed, "