xhci: split allocate interrupter into separate alloacte and add parts
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 2 Jun 2023 14:40:03 +0000 (17:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Jun 2023 09:34:50 +0000 (11:34 +0200)
commit4bf398e15aa410e25fa46a5684c7e5bf682ecc48
treef1b17e577ca100d58111b1713989343de2d9aeb7
parent0a4776205b16d038ec6fedef2094951fcb6f441b
xhci: split allocate interrupter into separate alloacte and add parts

The current function that both allocates and adds the interrupter isn't
optimal when using several interrupters. The array of interrupters need
to be protected with a lock while adding or removing interrupters.
If memory is allocated under the default xhci spinlock then GFP_KERNEL
can't be used.

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

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-6-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c