summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/dimm.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-05-04 21:47:22 +0300
committerDan Williams <dan.j.williams@intel.com>2017-05-05 01:41:39 +0300
commit9d62ed96511823fa9c2ac7a819d7b4be22a9a6de (patch)
tree960201b66f5fb6733dda4ab6b274fe6fafcf0e29 /drivers/nvdimm/dimm.c
parent8f078b38dd382710884ce7abd31a1935c440e6f8 (diff)
downloadlinux-9d62ed96511823fa9c2ac7a819d7b4be22a9a6de.tar.xz
libnvdimm: handle locked label storage areas
Per the latest version of the "NVDIMM DSM Interface Example" [1], the label data retrieval routine can report a "locked" status. In this case all regions associated with that DIMM are disabled until the label area is unlocked. Provide generic libnvdimm enabling for NVDIMMs with label data area locking capabilities. [1]: http://pmem.io/documents/ Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/dimm.c')
-rw-r--r--drivers/nvdimm/dimm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c
index ee0b412827bf..e0f0e3ce1a32 100644
--- a/drivers/nvdimm/dimm.c
+++ b/drivers/nvdimm/dimm.c
@@ -49,6 +49,8 @@ static int nvdimm_probe(struct device *dev)
kref_init(&ndd->kref);
rc = nvdimm_init_nsarea(ndd);
+ if (rc == -EACCES)
+ nvdimm_set_locked(dev);
if (rc)
goto err;