[PATCH v5 0/3] pull region-specific logic into new files

Gregory Price posted 3 patches 6 days, 13 hours ago
drivers/cxl/core/Makefile      |   2 +-
drivers/cxl/core/core.h        |   2 +
drivers/cxl/core/region.c      | 283 ---------------------------------
drivers/cxl/core/region_dax.c  | 106 ++++++++++++
drivers/cxl/core/region_pmem.c | 191 ++++++++++++++++++++++
drivers/cxl/cxl.h              |   1 +
tools/testing/cxl/Kbuild       |   2 +-
7 files changed, 302 insertions(+), 285 deletions(-)
create mode 100644 drivers/cxl/core/region_dax.c
create mode 100644 drivers/cxl/core/region_pmem.c
[PATCH v5 0/3] pull region-specific logic into new files
Posted by Gregory Price 6 days, 13 hours ago
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.

v4 -> v5:  Ira test fixes
           Jonathan nit fixes

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
  cxl/core: use cleanup.h for devm_cxl_add_dax_region

 drivers/cxl/core/Makefile      |   2 +-
 drivers/cxl/core/core.h        |   2 +
 drivers/cxl/core/region.c      | 283 ---------------------------------
 drivers/cxl/core/region_dax.c  | 106 ++++++++++++
 drivers/cxl/core/region_pmem.c | 191 ++++++++++++++++++++++
 drivers/cxl/cxl.h              |   1 +
 tools/testing/cxl/Kbuild       |   2 +-
 7 files changed, 302 insertions(+), 285 deletions(-)
 create mode 100644 drivers/cxl/core/region_dax.c
 create mode 100644 drivers/cxl/core/region_pmem.c

-- 
2.53.0
Re: [PATCH v5 0/3] pull region-specific logic into new files
Posted by Dave Jiang 5 days, 20 hours ago

On 3/26/26 7:02 PM, 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.
> 
> v4 -> v5:  Ira test fixes
>            Jonathan nit fixes
> 
> 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
>   cxl/core: use cleanup.h for devm_cxl_add_dax_region
> 
>  drivers/cxl/core/Makefile      |   2 +-
>  drivers/cxl/core/core.h        |   2 +
>  drivers/cxl/core/region.c      | 283 ---------------------------------
>  drivers/cxl/core/region_dax.c  | 106 ++++++++++++
>  drivers/cxl/core/region_pmem.c | 191 ++++++++++++++++++++++
>  drivers/cxl/cxl.h              |   1 +
>  tools/testing/cxl/Kbuild       |   2 +-
>  7 files changed, 302 insertions(+), 285 deletions(-)
>  create mode 100644 drivers/cxl/core/region_dax.c
>  create mode 100644 drivers/cxl/core/region_pmem.c
> 

I applied to for-7.1/cxl-region-refactor branch and pushed to the cxl.git so it gets 0-day coverage. But I'm going hold off until the end to merge this in case of merge conflicts.

29990ab5cb40 cxl/core: use cleanup.h for devm_cxl_add_dax_region
d747cf98f091 cxl/core/region: move dax region device logic into region_dax.c
8a1ec5fb2360 cxl/core/region: move pmem region driver logic into region_pmem.c