diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-11-28 11:15:18 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-11-28 11:15:18 -0800 |
commit | 450c6633e874c4d38112b39647831f67b41a8067 (patch) | |
tree | b2d9813afd5677de59c2070940796f04af3abbce /drivers/dax | |
parent | 2d9a02744f5a2e8325fc0c3e5533593261cead0a (diff) | |
download | op-kernel-dev-450c6633e874c4d38112b39647831f67b41a8067.zip op-kernel-dev-450c6633e874c4d38112b39647831f67b41a8067.tar.gz |
libnvdimm: use consistent naming for request_mem_region()
Here is an example /proc/iomem listing for a system with 2 namespaces,
one in "sector" mode and one in "memory" mode:
1fc000000-2fbffffff : Persistent Memory (legacy)
1fc000000-2fbffffff : namespace1.0
340000000-34fffffff : Persistent Memory
340000000-34fffffff : btt0.1
Here is the corresponding ndctl listing:
# ndctl list
[
{
"dev":"namespace1.0",
"mode":"memory",
"size":4294967296,
"blockdev":"pmem1"
},
{
"dev":"namespace0.0",
"mode":"sector",
"size":267091968,
"uuid":"f7594f86-badb-4592-875f-ded577da2eaf",
"sector_size":4096,
"blockdev":"pmem0s"
}
]
Notice that the ndctl listing is purely in terms of namespace devices,
while the iomem listing leaks the internal "btt0.1" implementation
detail. Given that ndctl requires the namespace device name to change
the mode, for example:
# ndctl create-namespace --reconfig=namespace0.0 --mode=raw --force
...use the namespace name in the iomem listing to keep the claiming
device name consistent across different mode settings.
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/pmem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index 9630d88..3ff8478 100644 --- a/drivers/dax/pmem.c +++ b/drivers/dax/pmem.c @@ -87,7 +87,8 @@ static int dax_pmem_probe(struct device *dev) pfn_sb = nd_pfn->pfn_sb; if (!devm_request_mem_region(dev, nsio->res.start, - resource_size(&nsio->res), dev_name(dev))) { + resource_size(&nsio->res), + dev_name(&ndns->dev))) { dev_warn(dev, "could not reserve region %pR\n", &nsio->res); return -EBUSY; } |