xhci: split free interrupter into separate remove and free parts
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 19 Oct 2023 10:29:21 +0000 (13:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Oct 2023 10:38:54 +0000 (12:38 +0200)
commit47f503cf5f799ec02e5f4b7c3b9afe145eca2aef
tree3f56801d13fbf14377e05302b54d975d4020ea78
parenta5d6264b638efeca35eff72177fd28d149e0764b
xhci: split free interrupter into separate remove and free parts

The current function that both removes and frees an interrupter isn't
optimal when using several interrupters. The array of interrupters need
to be protected with a lock while removing interrupters, but the default
xhci spin lock can't be used while freeing the interrupters event ring
segment table as dma_free_coherent() should be called with IRQs enabled.

There is no need to free the interrupter under the lock, so split this
code into separate unlocked free part, and a lock protected remove part.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231019102924.2797346-17-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c