libnvdimm, nfit: fix persistence domain reporting
authorDan Williams <dan.j.williams@intel.com>
Wed, 21 Mar 2018 22:12:07 +0000 (15:12 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 21 Mar 2018 22:12:07 +0000 (15:12 -0700)
commitfe9a552e715dfe5167d52deb74ea16335896bdaf
treef47ac26b9a82ebde8c4a1380fe1ea1571e52ac3b
parent896196dc4e419a9d0782404e0befac17d638fc01
libnvdimm, nfit: fix persistence domain reporting

The persistence domain is a point in the platform where once writes
reach that destination the platform claims it will make them persistent
relative to power loss. In the ACPI NFIT this is currently communicated
as 2 bits in the "NFIT - Platform Capabilities Structure". The bits
comprise a hierarchy, i.e. bit0 "CPU Cache Flush to NVDIMM Durability on
Power Loss Capable" implies bit1 "Memory Controller Flush to NVDIMM
Durability on Power Loss Capable".

Commit 96c3a239054a "libnvdimm: expose platform persistence attr..."
shows the persistence domain as flags, but it's really an enumerated
hierarchy.

Fix this newly introduced user ABI to show the closest available
persistence domain before userspace develops dependencies on seeing, or
needing to develop code to tolerate, the raw NFIT flags communicated
through the libnvdimm-generic region attribute.

Fixes: 96c3a239054a ("libnvdimm: expose platform persistence attr...")
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/nfit/core.c
drivers/nvdimm/region_devs.c