Re: [PATCH 4/9] drivers/cxl,dax: add dax driver mode selection for dax regions

Jonathan Cameron
2026-02-02T17:54:24Z

On Thu, 29 Jan 2026 16:04:37 -0500
Gregory Price <gourry@gourry.net> wrote:

> CXL regions may wish not to auto-configure their memory as dax kmem,
> but the current plumbing defaults all cxl-created dax devices to the
> kmem driver. This exposes them to hotplug policy, even if the user
> intends to use the memory as a dax device.
>
> Add plumbing to allow CXL drivers to select whether a DAX region should
> default to kmem (DAXDRV_KMEM_TYPE) or device (DAXDRV_DEVICE_TYPE).
>
> Add a 'dax_driver' field to struct cxl_dax_region and update
> devm_cxl_add_dax_region() to take a dax_driver_type parameter.
>
> In drivers/dax/cxl.c, the IORESOURCE_DAX_KMEM flag used by dax driver
> matching code is now set conditionally based on dax_region->dax_driver.
>
> Exports `enum dax_driver_type` to linux/dax.h for use in the cxl driver.
>
> All current callers pass DAXDRV_KMEM_TYPE for backward compatibility.
>
> Cc: John Groves <john@jagalactic.com>
> Signed-off-by: Gregory Price <gourry@gourry.net>
LGTM
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>