Re: [PATCH 4/9] drivers/cxl,dax: add dax driver mode selection for dax regions
From: Jonathan Cameron
Date: Mon Feb 02 2026 - 12:55:10 EST
On Thu, 29 Jan 2026 16:04:37 -0500
Gregory Price <gourry@xxxxxxxxxx> 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@xxxxxxxxxxxxxx>
> Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
LGTM
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>