diff options
author | Dan Williams <dan.j.williams@intel.com> | 2023-02-10 01:07:07 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-02-10 17:33:34 -0800 |
commit | 7dab174e2e27eeaf10273e597ffbef4f8ea032bb (patch) | |
tree | 5f592cccf1aeba006b7a3a7af94f90091cc555ba /include/linux/dax.h | |
parent | fe098574a93b4e2acb046b583e9857337d807f38 (diff) | |
download | linux-7dab174e2e27eeaf10273e597ffbef4f8ea032bb.tar.gz linux-7dab174e2e27eeaf10273e597ffbef4f8ea032bb.tar.bz2 linux-7dab174e2e27eeaf10273e597ffbef4f8ea032bb.zip |
dax/hmem: Move hmem device registration to dax_hmem.ko
In preparation for the CXL region driver to take over the responsibility
of registering device-dax instances for CXL regions, move the
registration of "hmem" devices to dax_hmem.ko.
Previously the builtin component of this enabling
(drivers/dax/hmem/device.o) would register platform devices for each
address range and trigger the dax_hmem.ko module to load and attach
device-dax instances to those devices. Now, the ranges are collected
from the HMAT and EFI memory map walking, but the device creation is
deferred. A new "hmem_platform" device is created which triggers
dax_hmem.ko to load and register the platform devices.
Tested-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/167602002771.1924368.5653558226424530127.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r-- | include/linux/dax.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 2b5ecb591059..bf6258472e49 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -262,11 +262,14 @@ static inline bool dax_mapping(struct address_space *mapping) } #ifdef CONFIG_DEV_DAX_HMEM_DEVICES -void hmem_register_device(int target_nid, struct resource *r); +void hmem_register_resource(int target_nid, struct resource *r); #else -static inline void hmem_register_device(int target_nid, struct resource *r) +static inline void hmem_register_resource(int target_nid, struct resource *r) { } #endif +typedef int (*walk_hmem_fn)(struct device *dev, int target_nid, + const struct resource *res); +int walk_hmem_resources(struct device *dev, walk_hmem_fn fn); #endif |