diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-08-04 17:20:16 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-08-04 17:20:16 -0700 |
commit | 401c0a19c6c22efcaff85d5a64a396f9130da2ca (patch) | |
tree | 051deacfc826795636237e63d1c1741e5c32bdb1 /drivers/acpi/nfit | |
parent | 0dd69643061d78f3f9047c2382d8d77cca1ac943 (diff) | |
download | linux-401c0a19c6c22efcaff85d5a64a396f9130da2ca.tar.gz linux-401c0a19c6c22efcaff85d5a64a396f9130da2ca.tar.bz2 linux-401c0a19c6c22efcaff85d5a64a396f9130da2ca.zip |
nfit, libnvdimm, region: export 'position' in mapping info
It is useful to be able to know the position of a DIMM in an
interleave-set. Consider the case where the order of the DIMMs changes
causing a namespace to be invalidated because the interleave-set cookie no
longer matches. If the before and after state of each DIMM position is
known this state debugged by the system owner.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit')
-rw-r--r-- | drivers/acpi/nfit/core.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 19182d091587..be231a549eb0 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1835,6 +1835,30 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, cmp_map_compat, NULL); nd_set->altcookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0); + /* record the result of the sort for the mapping position */ + for (i = 0; i < nr; i++) { + struct nfit_set_info_map2 *map2 = &info2->mapping[i]; + int j; + + for (j = 0; j < nr; j++) { + struct nd_mapping_desc *mapping = &ndr_desc->mapping[j]; + struct nvdimm *nvdimm = mapping->nvdimm; + struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); + + if (map2->serial_number + == nfit_mem->dcr->serial_number && + map2->vendor_id + == nfit_mem->dcr->vendor_id && + map2->manufacturing_date + == nfit_mem->dcr->manufacturing_date && + map2->manufacturing_location + == nfit_mem->dcr->manufacturing_location) { + mapping->position = i; + break; + } + } + } + ndr_desc->nd_set = nd_set; devm_kfree(dev, info); devm_kfree(dev, info2); |