summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/region.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-06-08 02:00:04 +0200
committerDan Williams <dan.j.williams@intel.com>2016-07-12 00:09:26 +0200
commite5ae3b252c6732f838f5695170bbf2ea9fb5b9ff (patch)
tree33db4ea36acf0b1fe329e592b4cac6c266dfa7f5 /drivers/nvdimm/region.c
parentlibnvdimm, nfit: remove nfit_spa_map() infrastructure (diff)
downloadlinux-e5ae3b252c6732f838f5695170bbf2ea9fb5b9ff.tar.xz
linux-e5ae3b252c6732f838f5695170bbf2ea9fb5b9ff.zip
libnvdimm, nfit: move flush hint mapping to region-device driver-data
In preparation for triggering flushes of a DIMM's writes-posted-queue (WPQ) via the pmem driver move mapping of flush hint addresses to the region driver. Since this uses devm_nvdimm_memremap() the flush addresses will remain mapped while any region to which the dimm belongs is active. We need to communicate more information to the nvdimm core to facilitate this mapping, namely each dimm object now carries an array of flush hint address resources. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/region.c')
-rw-r--r--drivers/nvdimm/region.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c
index 05a912359939..333175dac8d5 100644
--- a/drivers/nvdimm/region.c
+++ b/drivers/nvdimm/region.c
@@ -20,7 +20,7 @@ static int nd_region_probe(struct device *dev)
{
int err, rc;
static unsigned long once;
- struct nd_region_namespaces *num_ns;
+ struct nd_region_data *ndrd;
struct nd_region *nd_region = to_nd_region(dev);
if (nd_region->num_lanes > num_online_cpus()
@@ -33,21 +33,21 @@ static int nd_region_probe(struct device *dev)
nd_region->num_lanes);
}
+ rc = nd_region_activate(nd_region);
+ if (rc)
+ return rc;
+
rc = nd_blk_region_init(nd_region);
if (rc)
return rc;
rc = nd_region_register_namespaces(nd_region, &err);
- num_ns = devm_kzalloc(dev, sizeof(*num_ns), GFP_KERNEL);
- if (!num_ns)
- return -ENOMEM;
-
if (rc < 0)
return rc;
- num_ns->active = rc;
- num_ns->count = rc + err;
- dev_set_drvdata(dev, num_ns);
+ ndrd = dev_get_drvdata(dev);
+ ndrd->ns_active = rc;
+ ndrd->ns_count = rc + err;
if (rc && err && rc == err)
return -ENODEV;