Re: [PATCH v4 0/3] pull region-specific logic into new files

From: Ira Weiny

Date: Thu Mar 26 2026 - 12:33:11 EST


Gregory Price wrote:
> cxl/core/region.c presently contains logic to handle cxl_region,
> cxl_pmem_region, and cxl_dax_region. The cxl_pmem_region and
> cxl_dax_region management code deserves new files to make it clear
> that this logic applies to a specific types of regions.
>
> This also breaks up development space so fewer conflicts can occur, and
> it becomes clear where changes are actually happening.
>
> I snuck in a cleanup.h fixup for devm_cxl_add_dax_region to tidy up some
> of the existing functions.
>
> v3 -> v4: address DJ's feedback on cleanup.h patch:
> move __free() declaration to assignment point
> restore local dev variable
>
> v2 -> v3: renamed from x_region to region_x because it's prettier
> added cleanup.h
> small nits asked for by Jonathan (commas)
>
> Gregory Price (3):
> cxl/core/region: move pmem region driver logic into region_pmem.c
> cxl/core/region: move dax region device logic into region_dax.c

Through some other testing I found these moves to cause failures in the
test code builds due to the new files.

The 2 patches below fix it.

Ira

commit 0248a89b7c798cbd32cf3e9eeb97a3fafb5ac15e
Author: Ira Weiny <ira.weiny@xxxxxxxxx>
Date: Mon Mar 23 15:48:52 2026 -0500

cxl/testing: Fix testing build; include region_dax.o

The cxl core testing module must have the same code as the cxl core. To
do this it uses the same source files in drivers/cxl/core. Adding a new
file there must be included in the test code.

Include region_dax.o in test file.

Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>

diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
index da6ef2c1fe0b..a6f18e93cf0d 100644
--- a/tools/testing/cxl/Kbuild
+++ b/tools/testing/cxl/Kbuild
@@ -61,6 +61,7 @@ cxl_core-y += $(CXL_CORE_SRC)/cdat.o
cxl_core-$(CONFIG_TRACING) += $(CXL_CORE_SRC)/trace.o
cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region.o
cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region_pmem.o
+cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region_dax.o
cxl_core-$(CONFIG_CXL_MCE) += $(CXL_CORE_SRC)/mce.o
cxl_core-$(CONFIG_CXL_FEATURES) += $(CXL_CORE_SRC)/features.o
cxl_core-$(CONFIG_CXL_EDAC_MEM_FEATURES) += $(CXL_CORE_SRC)/edac.o

commit a0dc872ac560b65f27eb41c003a02f67e3dc52e4
Author: Ira Weiny <ira.weiny@xxxxxxxxx>
Date: Mon Mar 23 15:45:42 2026 -0500

cxl/testing: Fix testing build; include region_pmem.o

The cxl core testing module must have the same code as the cxl core. To
do this it uses the same source files in drivers/cxl/core. Adding a new
file there must be included in the test code.

Include region_pmem.o in test file.

Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>

diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
index 53d84a6874b7..da6ef2c1fe0b 100644
--- a/tools/testing/cxl/Kbuild
+++ b/tools/testing/cxl/Kbuild
@@ -60,6 +60,7 @@ cxl_core-y += $(CXL_CORE_SRC)/pmu.o
cxl_core-y += $(CXL_CORE_SRC)/cdat.o
cxl_core-$(CONFIG_TRACING) += $(CXL_CORE_SRC)/trace.o
cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region.o
+cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region_pmem.o
cxl_core-$(CONFIG_CXL_MCE) += $(CXL_CORE_SRC)/mce.o
cxl_core-$(CONFIG_CXL_FEATURES) += $(CXL_CORE_SRC)/features.o
cxl_core-$(CONFIG_CXL_EDAC_MEM_FEATURES) += $(CXL_CORE_SRC)/edac.o