All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/9] cxl/region: Refactor cxl_port_setup_targets()
@ 2026-11-02 20:15 Alison Schofield
  2026-11-02 20:15 ` [PATCH v5 1/9] cxl: Add interleave encoding validity helpers Alison Schofield
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Alison Schofield @ 2026-11-02 20:15 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Li Ming, Richard Cheng
  Cc: linux-cxl


Changes in v5:
- Update patch 4 commit message w test result & benefit info (RichardC)
- Rebase on 7.4-rc1
v4: https://lore.kernel.org/all/cover.1792263750.git.alison.schofield@intel.com/

Changes in v4:
- Pass cxlsd to cxl_switch_port_setup_targets() (DaveJ)
- New Patch 4 from Richard, only calc peer distance on target reuse (RichardC)
- Add function comment to cxl_port_parent_interleave() (RichardC)
- New Patch 8 simplifies control flow (MingL, JonathanC)
- Remove claim in cover letter of a strictly mechanical refactor
- Drop LLM tags per latest guidance
v3: https://lore.kernel.org/linux-cxl/cover.1791860305.git.alison.schofield@intel.com/

Changes in v3:
- Drop patch "cxl/region: Name the interleave locals in cxl_port_setup_targets()".
- Move the distance comment above cxl_port_peer_distance() (Jonathan)
- Name the out-params out_iw/out_ig.
- Minor reverse fir and alignment cleanups
- Reorder the cxl_port_calc_interleave() declarations
v2: https://lore.kernel.org/linux-cxl/cover.1791676454.git.alison.schofield@intel.com/

Changes in v2:
- New patch 3 adds 'switch' to cxl_port_setup_targets() name (DaveJ)
- Add 'switch' to cxl_port_add_target() name (DaveJ)
- Pass the switch decoder to cxl_switch_port_add_target (DaveJ)
- Minor commit message updates based on function renamings
v1: https://lore.kernel.org/linux-cxl/cover.1791575481.git.alison.schofield@intel.com/


Begin Cover Letter:
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.

Patch 1 prepares the code that moves. It is a suggestion Jonathan offered
on the mixed gran series.

Patch 2 renames the function to cxl_switch_port_setup_targets(), since it
configures switch decoder targets, and changes its parameter to accept a
switch decoder rather than a port, both DaveJ suggestions.

Patches 3-9 extract the individual steps into helpers and add two new patches:
RichardC's patch 4 avoids calculating peer distance when an endpoint adds a
new target, and patch 8, suggested by Ming and Jonathan, removes the goto paths
before the final helper is extracted.

The result reduces cxl_switch_port_setup_targets() to 53 lines.

[1] https://lore.kernel.org/linux-cxl/cover.1788475206.git.alison.schofield@intel.com/


Alison Schofield (8):
  cxl: Add interleave encoding validity helpers
  cxl/region: Rename cxl_port_setup_targets() to
    cxl_switch_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: Simplify switch port target setup control flow
  cxl/region: Factor out cxl_switch_port_add_target()

Richard Cheng (1):
  cxl/region: Calculate peer distance only for reused targets

 drivers/cxl/core/region.c | 243 +++++++++++++++++++++++---------------
 drivers/cxl/cxl.h         |  21 ++++
 2 files changed, 172 insertions(+), 92 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.37.3


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

end of thread, other threads:[~2026-11-02 22:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 20:15 [PATCH v5 0/9] cxl/region: Refactor cxl_port_setup_targets() Alison Schofield
2026-11-02 20:15 ` [PATCH v5 1/9] cxl: Add interleave encoding validity helpers Alison Schofield
2026-11-02 20:15 ` [PATCH v5 2/9] cxl/region: Rename cxl_port_setup_targets() to cxl_switch_port_setup_targets() Alison Schofield
2026-11-02 20:15 ` [PATCH v5 3/9] cxl/region: Factor out cxl_port_peer_distance() Alison Schofield
2026-11-02 20:15 ` [PATCH v5 4/9] cxl/region: Calculate peer distance only for reused targets Alison Schofield
2026-11-02 20:16 ` [PATCH v5 5/9] cxl/region: Factor out cxl_port_parent_interleave() Alison Schofield
2026-11-02 20:16 ` [PATCH v5 6/9] cxl/region: Factor out cxl_port_calc_interleave() Alison Schofield
2026-11-02 20:16 ` [PATCH v5 7/9] cxl/region: Factor out cxl_port_setup_decoder() Alison Schofield
2026-11-02 20:16 ` [PATCH v5 8/9] cxl/region: Simplify switch port target setup control flow Alison Schofield
2026-11-02 20:16 ` [PATCH v5 9/9] cxl/region: Factor out cxl_switch_port_add_target() Alison Schofield
2026-11-02 22:06 ` [PATCH v5 0/9] cxl/region: Refactor cxl_port_setup_targets() Dave Jiang

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.