Subject: Re: [PATCH v10 04/26] cxl: move register/capability check to driver

From: Simon Horman <[email-masked]>
Date: Fri, 7 Feb 2025 12:52:23 +0000

On Wed, Feb 05, 2025 at 03:19:28PM +0000, [email-masked] wrote:
> From: Alejandro Lucero <[email-masked]>
> 
> Type3 has some mandatory capabilities which are optional for Type2.
> 
> In order to support same register/capability discovery code for both
> types, avoid any assumption about what capabilities should be there, and
> export the capabilities found for the caller doing the capabilities
> check based on the expected ones.
> 
> Signed-off-by: Alejandro Lucero <[email-masked]>

...

> diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c

...

> @@ -117,7 +124,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_probe_component_regs, "CXL");
>   * Probe for device register information and return it in map object.
>   */
>  void cxl_probe_device_regs(struct device *dev, void __iomem *base,
> -			   struct cxl_device_reg_map *map)
> +			   struct cxl_device_reg_map *map, unsigned long *caps)

nit: The Kernel doc for cxl_probe_device_regs() should also be updated
     to document caps.

...