mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
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>
This commit is contained in:
@@ -2236,14 +2236,21 @@ static int init_active_labels(struct nd_region *nd_region)
|
||||
int count, j;
|
||||
|
||||
/*
|
||||
* If the dimm is disabled then prevent the region from
|
||||
* being activated if it aliases DPA.
|
||||
* If the dimm is disabled then we may need to prevent
|
||||
* the region from being activated.
|
||||
*/
|
||||
if (!ndd) {
|
||||
if (!test_bit(NDD_ALIASING, &nvdimm->flags))
|
||||
if (test_bit(NDD_LOCKED, &nvdimm->flags))
|
||||
/* fail, label data may be unreadable */;
|
||||
else if (test_bit(NDD_ALIASING, &nvdimm->flags))
|
||||
/* fail, labels needed to disambiguate dpa */;
|
||||
else
|
||||
return 0;
|
||||
dev_dbg(&nd_region->dev, "%s: is disabled, failing probe\n",
|
||||
dev_name(&nd_mapping->nvdimm->dev));
|
||||
|
||||
dev_err(&nd_region->dev, "%s: is %s, failing probe\n",
|
||||
dev_name(&nd_mapping->nvdimm->dev),
|
||||
test_bit(NDD_LOCKED, &nvdimm->flags)
|
||||
? "locked" : "disabled");
|
||||
return -ENXIO;
|
||||
}
|
||||
nd_mapping->ndd = ndd;
|
||||
|
||||
Reference in New Issue
Block a user