@@ -1865,8 +1889,15 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
cancel_delayed_work_sync(&xhci->cmd_timer);
- xhci_free_interrupter(xhci, xhci->interrupter);
- xhci->interrupter = NULL;
+ for (i = 1; i < xhci->max_interrupters; i++) {
+ if (xhci->interrupters[i])
+ xhci_remove_secondary_interrupter(xhci_to_hcd(xhci),
+ xhci->interrupters[i]);
+ }
+
+ /* free the primary interrupter, interrupter number 0 */
+ xhci_free_interrupter(xhci, xhci->interrupters[0]);
+ xhci->interrupters[0] = NULL;
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed primary event ring");
+ if (idx > 0) {
+ ir = xhci_alloc_interrupter(xhci, idx, GFP_KERNEL);
+ if (!ir) {
+ spin_unlock_irqrestore(&xhci->lock, flags);