linux/drivers/nvdimm
Vaibhav Jain 61ca5b6532 libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC
commit a2948b17f6b936fc52f86c0f92c46d2f91928b79 upstream.

In case a platform doesn't provide explicit flush-hints but provides an
explicit flush callback via ND_REGION_ASYNC region flag, then
nvdimm_has_flush() still returns '0' indicating that writes do not
require flushing. This happens on PPC64 with patch at [1] applied, where
'deep_flush' of a region was denied even though an explicit flush
function was provided.

Fix this by adding a condition to nvdimm_has_flush() to test for the
ND_REGION_ASYNC flag on the region and see if a 'region->flush' callback
is assigned.

Link: http://lore.kernel.org/r/161703936121.36.7260632399582101498.stgit@e1fbed493c87 [1]
Fixes: c5d4355d10 ("libnvdimm: nd_region flush callback support")
Reported-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Link: https://lore.kernel.org/r/20210402092555.208590-1-vaibhav@linux.ibm.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-21 12:56:16 +02:00
..
Kconfig
Makefile
badrange.c
blk.c
btt.c
btt.h
btt_devs.c
bus.c
claim.c
core.c
dax_devs.c
dimm.c
dimm_devs.c libnvdimm/dimm: Avoid race between probe and available_slots_show() 2021-02-10 09:25:30 +01:00
e820.c
label.c libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels 2020-12-30 11:51:47 +01:00
label.h
namespace_devs.c
nd-core.h
nd.h
nd_virtio.c
of_pmem.c
pfn.h
pfn_devs.c
pmem.c
pmem.h
region.c
region_devs.c libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC 2021-04-21 12:56:16 +02:00
security.c
virtio_pmem.c
virtio_pmem.h