remarkable-linux/drivers/nvdimm
Dan Williams f284a4f237 libnvdimm: introduce nvdimm_flush() and nvdimm_has_flush()
nvdimm_flush() is a replacement for the x86 'pcommit' instruction.  It is
an optional write flushing mechanism that an nvdimm bus can provide for
the pmem driver to consume.  In the case of the NFIT nvdimm-bus-provider
nvdimm_flush() is implemented as a series of flush-hint-address [1]
writes to each dimm in the interleave set (region) that backs the
namespace.

The nvdimm_has_flush() routine relies on platform firmware to describe
the flushing capabilities of a platform.  It uses the heuristic of
whether an nvdimm bus provider provides flush address data to return a
ternary result:

      1: flush addresses defined
      0: dimm topology described without flush addresses (assume ADR)
 -errno: no topology information, unable to determine flush mechanism

The pmem driver is expected to take the following actions on this ternary
result:

      1: nvdimm_flush() in response to REQ_FUA / REQ_FLUSH and shutdown
      0: do not set, WC or FUA on the queue, take no further action
 -errno: warn and then operate as if nvdimm_has_flush() returned '0'

The caveat of this heuristic is that it can not distinguish the "dimm
does not have flush address" case from the "platform firmware is broken
and failed to describe a flush address".  Given we are already
explicitly trusting the NFIT there's not much more we can do beyond
blacklisting broken firmwares if they are ever encountered.

Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2016-07-11 16:13:42 -07:00
..
blk.c libnvdimm: use devm_add_action_or_reset() 2016-06-15 14:59:17 -07:00
btt.c Merge branch 'for-4.7/libnvdimm' into libnvdimm-for-next 2016-05-18 10:06:48 -07:00
btt.h libnvdimm, btt: consolidate arena validation 2015-08-14 13:43:04 -04:00
btt_devs.c libnvdimm, pmem, pfn: make pmem_rw_bytes generic and refactor pfn setup 2016-04-22 12:26:23 -07:00
bus.c libnvdimm: IS_ERR() usage cleanup 2016-06-17 16:23:23 -07:00
claim.c libnvdimm: IS_ERR() usage cleanup 2016-06-17 16:23:23 -07:00
core.c libnvdimm: introduce devm_nvdimm_memremap(), convert nfit_spa_map() users 2016-07-07 17:11:09 -07:00
dax_devs.c libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
dimm.c libnvdimm: pmem label sets and namespace instantiation. 2015-06-24 21:24:10 -04:00
dimm_devs.c libnvdimm, nfit: move flush hint mapping to region-device driver-data 2016-07-11 15:09:26 -07:00
e820.c x86, kexec, nvdimm: Use walk_iomem_res_desc() for iomem search 2016-01-30 09:49:59 +01:00
Kconfig libnvdimm: introduce devm_nvdimm_memremap(), convert nfit_spa_map() users 2016-07-07 17:11:09 -07:00
label.c libnvdimm: infrastructure for btt devices 2015-06-25 04:20:04 -04:00
label.h libnvdimm: write blk label set 2015-06-24 21:24:10 -04:00
Makefile libnvdimm, dax: introduce device-dax infrastructure 2016-05-09 15:35:42 -07:00
namespace_devs.c libnvdimm, dax: introduce device-dax infrastructure 2016-05-09 15:35:42 -07:00
nd-core.h libnvdimm, nfit: move flush hint mapping to region-device driver-data 2016-07-11 15:09:26 -07:00
nd.h libnvdimm, nfit: move flush hint mapping to region-device driver-data 2016-07-11 15:09:26 -07:00
pfn.h libnvdimm, dax: autodetect support 2016-05-20 22:02:57 -07:00
pfn_devs.c Merge branch 'for-4.7/dax' into libnvdimm-for-next 2016-05-21 12:33:04 -07:00
pmem.c libnvdimm: introduce nvdimm_flush() and nvdimm_has_flush() 2016-07-11 16:13:42 -07:00
pmem.h libnvdimm, pmem: allow nfit_test to override pmem_direct_access() 2016-06-24 11:39:29 -07:00
region.c libnvdimm: keep region data alive over namespace removal 2016-07-11 16:13:41 -07:00
region_devs.c libnvdimm: introduce nvdimm_flush() and nvdimm_has_flush() 2016-07-11 16:13:42 -07:00