Subject: Re: [PATCH v20 04/22] cxl: Add type2 device basic support

From: Jonathan Cameron <[email-masked]>
Date: Wed, 12 Nov 2025 15:33:34 +0000

On Mon, 10 Nov 2025 15:36:39 +0000
[email-masked] wrote:

> From: Alejandro Lucero <[email-masked]>
> 
> Differentiate CXL memory expanders (type 3) from CXL device accelerators
> (type 2) with a new function for initializing cxl_dev_state and a macro
> for helping accel drivers to embed cxl_dev_state inside a private
> struct.
> 
> Move structs to include/cxl as the size of the accel driver private
> struct embedding cxl_dev_state needs to know the size of this struct.
> 
> Use same new initialization with the type3 pci driver.
> 
> Signed-off-by: Alejandro Lucero <[email-masked]>
> Reviewed-by: Jonathan Cameron <[email-masked]>
> Reviewed-by: Dave Jiang <[email-masked]>
> Reviewed-by: Alison Schofield <[email-masked]>
> Reviewed-by: Ben Cheatham <[email-masked]>
One minor thing that's probably a merge conflict gone slightly wrong
or something like that. After this patch you end up with two
CXL_NR_PARTITIONS_MAX defines.

> ---
>  drivers/cxl/core/mbox.c      |  12 +-
>  drivers/cxl/core/memdev.c    |  32 +++++
>  drivers/cxl/core/pci_drv.c   |  15 +--
>  drivers/cxl/cxl.h            |  97 +--------------
>  drivers/cxl/cxlmem.h         |  85 +------------
>  include/cxl/cxl.h            | 226 +++++++++++++++++++++++++++++++++++
>  tools/testing/cxl/test/mem.c |   3 +-
>  7 files changed, 276 insertions(+), 194 deletions(-)
>  create mode 100644 include/cxl/cxl.h
> 

> diff --git a/include/cxl/cxl.h b/include/cxl/cxl.h
> new file mode 100644
> index 000000000000..13d448686189
> --- /dev/null
> +++ b/include/cxl/cxl.h
> @@ -0,0 +1,226 @@

> +#define CXL_NR_PARTITIONS_MAX 2
Adds a definition but doesn't remove the one in driver/cxl/cxlmem.h
That seems odd.