Linux USB
 help / color / mirror / Atom feed
From: Niklas Neronin <niklas.neronin@linux.intel.com>
To: mathias.nyman@linux.intel.com
Cc: linux-usb@vger.kernel.org,
	Niklas Neronin <niklas.neronin@linux.intel.com>
Subject: [PATCH 0/3] usb: xhci: allocate arrays based on supported slot amount
Date: Thu,  7 May 2026 10:39:42 +0200	[thread overview]
Message-ID: <20260507083945.959370-1-niklas.neronin@linux.intel.com> (raw)

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


             reply	other threads:[~2026-05-07  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  8:39 Niklas Neronin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260507083945.959370-1-niklas.neronin@linux.intel.com \
    --to=niklas.neronin@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox