rc = nvdimm_check_config_data(dev); if (rc) { /* not required for non-aliased nvdimm, ex. NVDIMM-N */ if (rc == -ENOTTY)
rc = 0; return rc;
}
/* * The locked status bit reflects explicit status codes from the * label reading commands, revalidate it each time the driver is * activated and re-reads the label area.
*/
nvdimm_clear_locked(dev);
ndd = kzalloc(sizeof(*ndd), GFP_KERNEL); if (!ndd) return -ENOMEM;
/* * Attempt to unlock, if the DIMM supports security commands, * otherwise the locked indication is determined by explicit * status codes from the label reading commands.
*/
rc = nvdimm_security_unlock(dev); if (rc < 0)
dev_dbg(dev, "failed to unlock dimm: %d\n", rc);
/* * EACCES failures reading the namespace label-area-properties * are interpreted as the DIMM capacity being locked but the * namespace labels themselves being accessible.
*/
rc = nvdimm_init_nsarea(ndd); if (rc == -EACCES) { /* * See nvdimm_namespace_common_probe() where we fail to * allow namespaces to probe while the DIMM is locked, * but we do allow for namespace enumeration.
*/
nvdimm_set_locked(dev);
rc = 0;
} if (rc) goto err;
/* * EACCES failures reading the namespace label-data are * interpreted as the label area being locked in addition to the * DIMM capacity. We fail the dimm probe to prevent regions from * attempting to parse the label area.
*/
rc = nd_label_data_init(ndd); if (rc == -EACCES)
nvdimm_set_locked(dev); if (rc) goto err;
dev_dbg(dev, "config data size: %d\n", ndd->nsarea.config_size);
nvdimm_bus_lock(dev); if (ndd->ns_current >= 0) {
rc = nd_label_reserve_dpa(ndd); if (rc == 0)
nvdimm_set_labeling(dev);
}
nvdimm_bus_unlock(dev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.