linux-stable/drivers/nvdimm
Vaibhav Jain eb82199e37 libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC
commit a2948b17f6 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 13:00:55 +02:00
..
badrange.c mm/memremap_pages: convert to 'struct range' 2020-10-13 18:38:28 -07:00
blk.c nvdimm: simplify revalidate_disk handling 2020-09-02 08:00:07 -06:00
btt.c bdi: remove BDI_CAP_SYNCHRONOUS_IO 2020-09-24 13:43:39 -06:00
btt.h
btt_devs.c
bus.c nvdimm: simplify revalidate_disk handling 2020-09-02 08:00:07 -06:00
claim.c mm/memremap_pages: convert to 'struct range' 2020-10-13 18:38:28 -07:00
core.c
dax_devs.c
dimm.c
dimm_devs.c libnvdimm/dimm: Avoid race between probe and available_slots_show() 2021-02-10 09:29:17 +01:00
e820.c
Kconfig
label.c libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels 2020-12-30 11:54:27 +01:00
label.h
Makefile
namespace_devs.c libnvdimm/namespace: Fix visibility of namespace resource attribute 2021-02-10 09:29:16 +01:00
nd-core.h
nd.h mm/memremap_pages: convert to 'struct range' 2020-10-13 18:38:28 -07:00
nd_virtio.c
of_pmem.c
pfn.h
pfn_devs.c mm/memremap_pages: support multiple ranges per invocation 2020-10-13 18:38:28 -07:00
pmem.c mm/memremap_pages: support multiple ranges per invocation 2020-10-13 18:38:28 -07:00
pmem.h
region.c mm/memremap_pages: convert to 'struct range' 2020-10-13 18:38:28 -07:00
region_devs.c libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC 2021-04-21 13:00:55 +02:00
security.c libnvdimm for 5.9 2020-08-11 10:59:19 -07:00
virtio_pmem.c
virtio_pmem.h