From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Dan Williams , Jeff Moyer , Christoph Hellwig , Matthew Wilcox , Ross Zwisler , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 152/293] libnvdimm, pmem: fix persistence warning Date: Mon, 9 Apr 2018 00:24:52 +0000 Message-ID: <20180409002239.163177-152-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Dan Williams [ Upstream commit c00b396ef782cb2296200d868a0013d8ca1d615e ] The pmem driver assumes if platform firmware describes the memory devices associated with a persistent memory range and CONFIG_ARCH_HAS_PMEM_API=3Dy that it has all the mechanism necessary to flush data to a power-fail safe zone. We warn if the firmware does not describe memory devices, but we also need to warn if the architecture does not claim pmem support. Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Ross Zwisler Reviewed-by: Jan Kara Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- drivers/nvdimm/region_devs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index f62306246ca4..2ac9c6222914 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -970,8 +970,9 @@ int nvdimm_has_flush(struct nd_region *nd_region) { int i; =20 - /* no nvdimm =3D=3D flushing capability unknown */ - if (nd_region->ndr_mappings =3D=3D 0) + /* no nvdimm or pmem api =3D=3D flushing capability unknown */ + if (nd_region->ndr_mappings =3D=3D 0 + || !IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)) return -ENXIO; =20 for (i =3D 0; i < nd_region->ndr_mappings; i++) { --=20 2.15.1