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

Commit 2fe6746c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "xhci: Cleanup only when releasing primary hcd"

parents 0b2b5b26 74c0d252
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2681,7 +2681,8 @@ hw_died:
		writel(irq_pending, &xhci->ir_set->irq_pending);
	}

	if (xhci->xhc_state & XHCI_STATE_DYING) {
	if (xhci->xhc_state & XHCI_STATE_DYING ||
	    xhci->xhc_state & XHCI_STATE_HALTED) {
		xhci_dbg(xhci, "xHCI dying, ignoring interrupt. "
				"Shouldn't IRQs be disabled?\n");
		/* Clear the event handler busy flag (RW1C);
+11 −18
Original line number Diff line number Diff line
@@ -676,15 +676,6 @@ int xhci_run(struct usb_hcd *hcd)
}
EXPORT_SYMBOL_GPL(xhci_run);

static void xhci_only_stop_hcd(struct usb_hcd *hcd)
{
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);

	spin_lock_irq(&xhci->lock);
	xhci_halt(xhci);
	spin_unlock_irq(&xhci->lock);
}

/*
 * Stop xHCI driver.
 *
@@ -701,19 +692,21 @@ void xhci_stop(struct usb_hcd *hcd)

	mutex_lock(&xhci->mutex);

	if (!usb_hcd_is_primary_hcd(hcd)) {
		xhci_only_stop_hcd(xhci->shared_hcd);
		mutex_unlock(&xhci->mutex);
		return;
	}

	if (!(xhci->xhc_state & XHCI_STATE_HALTED)) {
		spin_lock_irq(&xhci->lock);
	/* Make sure the xHC is halted for a USB3 roothub
	 * (xhci_stop() could be called as part of failed init).
	 */

		xhci->xhc_state |= XHCI_STATE_HALTED;
		xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
		xhci_halt(xhci);
		xhci_reset(xhci);

		spin_unlock_irq(&xhci->lock);
	}

	if (!usb_hcd_is_primary_hcd(hcd)) {
		mutex_unlock(&xhci->mutex);
		return;
	}

	xhci_cleanup_msix(xhci);