Re: [PATCH v9 01/11] cxl: Split decoder programming into a reusable helper

From: Alejandro Lucero Palau

Date: Wed Jul 15 2026 - 10:02:48 EST



On 7/9/26 02:02, Srirangan Madhavan wrote:
Move common HDM decoder settings to include/cxl/cxl.h and route the
register programming sequence through cxl_commit(). This lets reset code
restore cached HDM state without depending on private cxl_core types while
keeping hdm.c in charge of the existing commit policy checks.

Build the low-level HDM helper under CONFIG_CXL_HDM so it is available even
when cxl_core is modular.

Signed-off-by: Srirangan Madhavan <smadhavan@xxxxxxxxxx>
---
drivers/cxl/Kconfig | 4 ++
drivers/cxl/core/Makefile | 1 +
drivers/cxl/core/hdm.c | 122 ++++-------------------------------
drivers/cxl/core/region.c | 6 +-
drivers/cxl/core/reset.c | 118 +++++++++++++++++++++++++++++++++
drivers/cxl/cxl.h | 43 ------------
include/cxl/cxl.h | 55 +++++++++++++++-
tools/testing/cxl/test/cxl.c | 10 +--
8 files changed, 197 insertions(+), 162 deletions(-)
create mode 100644 drivers/cxl/core/reset.c


<snip>


/*
* Track whether this decoder is free for userspace provisioning, reserved for
* region autodiscovery, whether it is started connecting (awaiting other
@@ -322,7 +281,6 @@ enum cxl_decoder_state {
* struct cxl_endpoint_decoder - Endpoint / SPA to DPA decoder
* @cxld: base cxl_decoder_object
* @dpa_res: actively claimed DPA span of this decoder
- * @skip: offset into @dpa_res where @cxld.hpa_range maps
* @state: autodiscovery state
* @part: partition index this decoder maps
* @pos: interleave position in @cxld.region
@@ -330,7 +288,6 @@ enum cxl_decoder_state {
struct cxl_endpoint_decoder {
struct cxl_decoder cxld;
struct resource *dpa_res;
- resource_size_t skip;


I understand this change moving skip to the cxl_decoder struct, but I do not undertand why dpa_res is not moved as well since skip refers to an offset inside dpa_res. Doesn't it?


If I am right this assumes only one decoder and mapping all the DPA. Is this the intention?