Commit 20a09a2e authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman

usb: xhci: dbc: Don't free all memory with spinlock held

commit 8867ea26 upstream.

The xhci debug capability (DbC) feature did its memory cleanup with
spinlock held. dma_free_coherent() warns if called with interrupts
disabled

move the memory cleanup outside the spinlock

Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c81b8722
...@@ -516,7 +516,6 @@ static int xhci_do_dbc_stop(struct xhci_hcd *xhci) ...@@ -516,7 +516,6 @@ static int xhci_do_dbc_stop(struct xhci_hcd *xhci)
return -1; return -1;
writel(0, &dbc->regs->control); writel(0, &dbc->regs->control);
xhci_dbc_mem_cleanup(xhci);
dbc->state = DS_DISABLED; dbc->state = DS_DISABLED;
return 0; return 0;
...@@ -562,8 +561,10 @@ static void xhci_dbc_stop(struct xhci_hcd *xhci) ...@@ -562,8 +561,10 @@ static void xhci_dbc_stop(struct xhci_hcd *xhci)
ret = xhci_do_dbc_stop(xhci); ret = xhci_do_dbc_stop(xhci);
spin_unlock_irqrestore(&dbc->lock, flags); spin_unlock_irqrestore(&dbc->lock, flags);
if (!ret) if (!ret) {
xhci_dbc_mem_cleanup(xhci);
pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller);
}
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment