From d5b3467f83afd1866eb096a40d752458a6bb2c64 Mon Sep 17 00:00:00 2001 From: Michal Kubecek Date: Mar 11 2020 12:27:02 +0000 Subject: Merge branch 'users/msuchanek/SLE15-SP2/for-next' into SLE15-SP2 Pull nvdimm fix from Michal Suchánek. --- diff --git a/patches.suse/libnvdimm-pfn_dev-Don-t-clear-device-memmap-area-dur.patch b/patches.suse/libnvdimm-pfn_dev-Don-t-clear-device-memmap-area-dur.patch new file mode 100644 index 0000000..d6f5ecd --- /dev/null +++ b/patches.suse/libnvdimm-pfn_dev-Don-t-clear-device-memmap-area-dur.patch @@ -0,0 +1,63 @@ +From c1f45d86a522d568aef541dbbc066ccac262b4c3 Mon Sep 17 00:00:00 2001 +From: "Aneesh Kumar K.V" +Date: Fri, 1 Nov 2019 08:57:28 +0530 +Subject: [PATCH] libnvdimm/pfn_dev: Don't clear device memmap area during + generic namespace probe + +References: bsc#1165929 bsc#1165950 bsc#1166323 +Patch-mainline: v5.5-rc1 +Git-commit: c1f45d86a522d568aef541dbbc066ccac262b4c3 + +nvdimm core use nd_pfn_validate when looking for devdax or fsdax namespace. In this +case device resources are allocated against nd_namespace_io dev. In-order to +allow remap of range in nd_pfn_clear_memmap_error(), move the device memmap +area clearing while initializing pfn namespace. With this device +resource are allocated against nd_pfn and we can use nd_pfn->dev for remapping. + +This also avoids calling nd_pfn_clear_mmap_errors twice. Once while probing the +namespace and second while initializing a pfn namespace. + +Signed-off-by: Aneesh Kumar K.V +Link: https://lore.kernel.org/r/20191101032728.113001-1-aneesh.kumar@linux.ibm.com +Signed-off-by: Dan Williams +Acked-by: Michal Suchanek +--- + drivers/nvdimm/pfn_devs.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c +index 60d81fae06ee..96727fd493f7 100644 +--- a/drivers/nvdimm/pfn_devs.c ++++ b/drivers/nvdimm/pfn_devs.c +@@ -591,7 +591,7 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig) + return -ENXIO; + } + +- return nd_pfn_clear_memmap_errors(nd_pfn); ++ return 0; + } + EXPORT_SYMBOL(nd_pfn_validate); + +@@ -729,6 +729,8 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) + sig = PFN_SIG; + + rc = nd_pfn_validate(nd_pfn, sig); ++ if (rc == 0) ++ return nd_pfn_clear_memmap_errors(nd_pfn); + if (rc != -ENODEV) + return rc; + +@@ -796,6 +798,10 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) + checksum = nd_sb_checksum((struct nd_gen_sb *) pfn_sb); + pfn_sb->checksum = cpu_to_le64(checksum); + ++ rc = nd_pfn_clear_memmap_errors(nd_pfn); ++ if (rc) ++ return rc; ++ + return nvdimm_write_bytes(ndns, SZ_4K, pfn_sb, sizeof(*pfn_sb), 0); + } + +-- +2.23.0 + diff --git a/series.conf b/series.conf index 6b4ff39..4960129 100644 --- a/series.conf +++ b/series.conf @@ -7008,6 +7008,7 @@ patches.suse/rpmsg-glink-Free-pending-deferred-work-on-remove.patch patches.suse/mailbox-imx-Fix-Tx-doorbell-shutdown-path.patch patches.suse/mailbox-imx-Clear-the-right-interrupts-at-shutdown.patch + patches.suse/libnvdimm-pfn_dev-Don-t-clear-device-memmap-area-dur.patch patches.suse/libnvdimm-namespace-Differentiate-between-probe-mapp.patch patches.suse/libnvdimm-export-the-target_node-attribute-for-regions-and-namespaces.patch patches.suse/Input-atmel_mxt_ts-disable-IRQ-across-suspend.patch