diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-06-06 17:42:38 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-07-07 17:11:09 -0700 |
commit | 29b9aa0aa3837c93ecd804dd3ada39b8cc75607d (patch) | |
tree | c3ee3dbe22fb1ec4a71ff887f382b3eac815d4b3 /include/linux/libnvdimm.h | |
parent | 81ed4e3670853e4cebad88aeffc0ba1d90d4d6ed (diff) | |
download | blackbird-op-linux-29b9aa0aa3837c93ecd804dd3ada39b8cc75607d.tar.gz blackbird-op-linux-29b9aa0aa3837c93ecd804dd3ada39b8cc75607d.zip |
libnvdimm: introduce devm_nvdimm_memremap(), convert nfit_spa_map() users
In preparation for generically mapping flush hint addresses for both the
BLK and PMEM use case, provide a generic / reference counted mapping
api. Given the fact that a dimm may belong to multiple regions (PMEM
and BLK), the flush hint addresses need to be held valid as long as any
region associated with the dimm is active. This is similar to the
existing BLK-region case where multiple BLK-regions may share an
aperture mapping. Up-level this shared / reference-counted mapping
capability from the nfit driver to a core nvdimm capability.
This eliminates the need for the nd_blk_region.disable() callback. Note
that the removal of nfit_spa_map() and related infrastructure is
deferred to a later patch.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/libnvdimm.h')
-rw-r--r-- | include/linux/libnvdimm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h index 0c3c30cbbea5..18c3cc48a970 100644 --- a/include/linux/libnvdimm.h +++ b/include/linux/libnvdimm.h @@ -99,6 +99,15 @@ struct nd_region_desc { unsigned long flags; }; +struct device; +void *devm_nvdimm_memremap(struct device *dev, resource_size_t offset, + size_t size, unsigned long flags); +static inline void __iomem *devm_nvdimm_ioremap(struct device *dev, + resource_size_t offset, size_t size) +{ + return (void __iomem *) devm_nvdimm_memremap(dev, offset, size, 0); +} + struct nvdimm_bus; struct module; struct device; |