From: Alison Schofield <alison.schofield@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jic23@kernel.org>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <iweiny@kernel.org>, Li Ming <ming.li@zohomail.com>,
Richard Cheng <icheng@nvidia.com>,
Robert Richter <rrichter@amd.com>
Cc: linux-cxl@vger.kernel.org
Subject: [PATCH 0/7] cxl/region: Refactor cxl_port_setup_targets()
Date: Fri, 9 Oct 2026 13:24:00 -0700 [thread overview]
Message-ID: <cover.1791575481.git.alison.schofield@intel.com> (raw)
cxl_port_setup_targets() has grown to nearly 200 lines. It open codes each
step of adding an endpoint to a port's decoder: finding the distance
between peer positions, reading the parent interleave, calculating and
validating the port's interleave, setting up the decoder, and adding the
target.
This set is inspired by review feedback from Robert Richter on the series
that adds mixed-granularity region support [1]. That series needs to change
how this function calculates interleaves and Robert asked for that new code
to be moved into a helper. Rather than tidy only the new code, this set
splits up the whole function first.
Patches 1 and 2 prepare the code that moves. Both patches are suggestions
that Jonathan offered on the mixed gran series, and Patch 2 is actually
plucked from the mixed gran series where it sat as a prep patch.
Patches 3-7 each move one step at a time into its own helper, which leaves
cxl_port_setup_targets() at 58 lines.
The refactor patches make no functional changes and aim to be mechanical
and easy to review. I tried to avoided all 'while you're at it' changes
that would muddy the mechanical split.
That base commit is from cxl/next, as of this moment.
[1] https://lore.kernel.org/linux-cxl/cover.1788475206.git.alison.schofield@intel.com/
Alison Schofield (7):
cxl: Add interleave encoding validity helpers
cxl/region: Name the interleave locals in cxl_port_setup_targets()
cxl/region: Factor out cxl_port_peer_distance()
cxl/region: Factor out cxl_port_parent_interleave()
cxl/region: Factor out cxl_port_calc_interleave()
cxl/region: Factor out cxl_port_setup_decoder()
cxl/region: Factor out cxl_port_add_target()
drivers/cxl/core/region.c | 252 +++++++++++++++++++++++---------------
drivers/cxl/cxl.h | 21 ++++
2 files changed, 176 insertions(+), 97 deletions(-)
base-commit: 71392a644e88c6bb921cdf12cb2b00adec070fe4
--
2.37.3
next reply other threads:[~2026-10-09 20:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 20:24 Alison Schofield [this message]
2026-10-09 20:24 ` [PATCH 1/7] cxl: Add interleave encoding validity helpers Alison Schofield
2026-10-09 22:14 ` Dave Jiang
2026-10-09 20:24 ` [PATCH 2/7] cxl/region: Name the interleave locals in cxl_port_setup_targets() Alison Schofield
2026-10-09 22:23 ` Dave Jiang
2026-10-09 20:24 ` [PATCH 3/7] cxl/region: Factor out cxl_port_peer_distance() Alison Schofield
2026-10-09 22:27 ` Dave Jiang
2026-10-09 20:24 ` [PATCH 4/7] cxl/region: Factor out cxl_port_parent_interleave() Alison Schofield
2026-10-09 22:39 ` Dave Jiang
2026-10-10 0:33 ` Alison Schofield
2026-10-09 20:24 ` [PATCH 5/7] cxl/region: Factor out cxl_port_calc_interleave() Alison Schofield
2026-10-09 22:45 ` Dave Jiang
2026-10-09 20:24 ` [PATCH 6/7] cxl/region: Factor out cxl_port_setup_decoder() Alison Schofield
2026-10-09 22:46 ` Dave Jiang
2026-10-09 20:24 ` [PATCH 7/7] cxl/region: Factor out cxl_port_add_target() Alison Schofield
2026-10-09 22:48 ` Dave Jiang
2026-10-10 0:36 ` Alison Schofield
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=cover.1791575481.git.alison.schofield@intel.com \
--to=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=icheng@nvidia.com \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=rrichter@amd.com \
--cc=vishal.l.verma@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.