Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: xhci: allocate arrays based on supported slot amount
@ 2026-05-07  8:39 Niklas Neronin
  2026-05-07  8:39 ` [PATCH 1/3] usb: xhci: refactor DCBAA struct Niklas Neronin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Niklas Neronin @ 2026-05-07  8:39 UTC (permalink / raw)
  To: mathias.nyman; +Cc: linux-usb, Niklas Neronin

The xHCI specification allows for up to 255 device slots, but the actual
number of slots supported by the controller may be lower.

Prior to this patch, the xhci driver allocated the devices and device
context pointer arrays to 255 slots, regardless of the supported amount.
Each entry is 8 bytes, which results in 4080 bytes being allocated even
on systems that support far fewer slots.

Address this by allocating these arrays based on the number of slots
supported by the controller. This approach is consistent with how the
driver already handles allocation for ports and interrupters.

Niklas Neronin (3):
  usb: xhci: refactor DCBAA struct
  usb: xhci: allocate DCBAA based on host controller max slots
  usb: xhci: allocate internal DCBAA mirror dynamically

 drivers/usb/host/xhci-mem.c  | 54 +++++++++++++++++++++---------------
 drivers/usb/host/xhci-ring.c |  6 ++--
 drivers/usb/host/xhci.c      | 10 +++----
 drivers/usb/host/xhci.h      | 27 ++++++++++--------
 4 files changed, 54 insertions(+), 43 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-07  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07  8:39 [PATCH 0/3] usb: xhci: allocate arrays based on supported slot amount Niklas Neronin
2026-05-07  8:39 ` [PATCH 1/3] usb: xhci: refactor DCBAA struct Niklas Neronin
2026-05-07  8:39 ` [PATCH 2/3] usb: xhci: allocate DCBAA based on host controller max slots Niklas Neronin
2026-05-07  8:39 ` [PATCH 3/3] usb: xhci: allocate internal DCBAA mirror dynamically Niklas Neronin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox