]> git.baikalelectronics.ru Git - kernel.git/commit
libnvdimm, region: fix flush hint table thinko
authorDan Williams <dan.j.williams@intel.com>
Sat, 24 Sep 2016 00:53:52 +0000 (17:53 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 24 Sep 2016 18:45:38 +0000 (11:45 -0700)
commitb8f0018e72059d8131eacfd1d92565c08ccb6f65
tree52feca3df3886d10dfc2fd1750658b212846cbb2
parent1b2c5ef94d2965b45194c6faf374d93cc545271f
libnvdimm, region: fix flush hint table thinko

The definition of the flush hint table as:

void __iomem *flush_wpq[0][0];

...passed the unit test, but is broken as flush_wpq[0][1] and
flush_wpq[1][0] refer to the same entry.  Fix this to use a helper that
calculates a slot in the table based on the geometry of flush hints in
the region.  This is important to get right since virtualization
solutions use this mechanism to trigger hypervisor flushes to platform
persistence.

Reported-by: Dave Jiang <dave.jiang@intel.com>
Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/nd.h
drivers/nvdimm/region_devs.c