Introduce dax_cxl_mode to coordinate between dax_cxl and dax_hmem when
handling CXL tagged memory ranges.

This patch defines the dax_cxl_mode enum and establishes a default policy.
Subsequent patches will wire this into dax_cxl and dax_hmem to decide
whether CXL tagged memory ranges should be deferred, registered or
dropped.

No functional changes.

Signed-off-by: Smita Koralahalli <[email protected]>
---
 drivers/dax/bus.c | 3 +++
 drivers/dax/bus.h | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index fde29e0ad68b..72bc5b76f061 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -24,6 +24,9 @@ DECLARE_RWSEM(dax_region_rwsem);
  */
 DECLARE_RWSEM(dax_dev_rwsem);
 
+enum dax_cxl_mode dax_cxl_mode = DAX_CXL_MODE_DEFER;
+EXPORT_SYMBOL_GPL(dax_cxl_mode);
+
 #define DAX_NAME_LEN 30
 struct dax_id {
        struct list_head list;
diff --git a/drivers/dax/bus.h b/drivers/dax/bus.h
index cbbf64443098..a40cbbf1e26b 100644
--- a/drivers/dax/bus.h
+++ b/drivers/dax/bus.h
@@ -41,6 +41,14 @@ struct dax_device_driver {
        void (*remove)(struct dev_dax *dev);
 };
 
+enum dax_cxl_mode {
+       DAX_CXL_MODE_DEFER,
+       DAX_CXL_MODE_REGISTER,
+       DAX_CXL_MODE_DROP,
+};
+
+extern enum dax_cxl_mode dax_cxl_mode;
+
 int __dax_driver_register(struct dax_device_driver *dax_drv,
                struct module *module, const char *mod_name);
 #define dax_driver_register(driver) \
-- 
2.17.1


Reply via email to