mbox series

[00/11] usb: xhci: decouple allocation and initialization

Message ID 20250411091155.3386971-1-niklas.neronin@linux.intel.com
Headers show
Series usb: xhci: decouple allocation and initialization | expand

Message

Niklas Neronin April 11, 2025, 9:11 a.m. UTC
Currently, after hibernation (S4 state), the xhci driver frees all its
memory and reallocates it from scratch, which is inefficient. Instead, much
of the memory can be simply re-initialized.

The proposed changes begin the process by decoupling initialization code
from memory allocation code. Specifically, the initialization code is moved
from xhci_mem_init() into separate functions, which are then called from
xhci_init().

By implementing these changes, future patches will be able to call the
initialization functions directly after hibernation, thereby improving
efficiency and enhancing code structure.

Niklas Neronin (11):
  usb: xhci: relocate pre-allocation initialization
  usb: xhci: move device slot enabling register write
  usb: xhci: move command ring pointer write
  usb: xhci: refactor xhci_set_cmd_ring_deq()
  usb: xhci: move DCBAA pointer write
  usb: xhci: move doorbell array pointer assignment
  usb: xhci: move enabling of USB 3 device notifications
  usb: xhci: remove error handling from xhci_add_interrupter()
  usb: xhci: move initialization of the primary interrupter
  usb: xhci: add individual allocation checks in xhci_mem_init()
  usb: xhci: cleanup xhci_mem_init()

 drivers/usb/host/xhci-caps.h |   4 +-
 drivers/usb/host/xhci-mem.c  | 164 +++++++++--------------------------
 drivers/usb/host/xhci.c      | 126 ++++++++++++++++++++++-----
 drivers/usb/host/xhci.h      |  12 +--
 4 files changed, 155 insertions(+), 151 deletions(-)