Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/testing/nvdimm: add watermarks for dax_pmem* modules

Add nfit_test 'watermarks' for the dax_pmem, dax_pmem_core, and
dax_pmem_compat modules. This causes the nfit_test module to fail
loading in case any of these modules are also not overridden with the
ldconfig wrapped modules. Without this, nfit_test would sometimes fail
creation of device-dax namespaces on the nfit_test_bus with an unhelpful
error log such as:

dax_pmem dax5.0: could not reserve metadata
dax_pmem: probe of dax5.0 failed with error -16

Which was caused due to the unwrapped version of
devm_request_mem_region() being called.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Vishal Verma and committed by
Dan Williams
92f6f2d7 d521fbae

+33
+3
tools/testing/nvdimm/Kbuild
··· 68 68 device_dax-y += config_check.o 69 69 70 70 dax_pmem-y := $(DAX_SRC)/pmem/pmem.o 71 + dax_pmem-y += dax_pmem_test.o 71 72 dax_pmem_core-y := $(DAX_SRC)/pmem/core.o 73 + dax_pmem_core-y += dax_pmem_core_test.o 72 74 dax_pmem_compat-y := $(DAX_SRC)/pmem/compat.o 75 + dax_pmem_compat-y += dax_pmem_compat_test.o 73 76 dax_pmem-y += config_check.o 74 77 75 78 libnvdimm-y := $(NVDIMM_SRC)/core.o
+8
tools/testing/nvdimm/dax_pmem_compat_test.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright(c) 2019 Intel Corporation. All rights reserved. 3 + 4 + #include <linux/module.h> 5 + #include <linux/printk.h> 6 + #include "watermark.h" 7 + 8 + nfit_test_watermark(dax_pmem_compat);
+8
tools/testing/nvdimm/dax_pmem_core_test.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright(c) 2019 Intel Corporation. All rights reserved. 3 + 4 + #include <linux/module.h> 5 + #include <linux/printk.h> 6 + #include "watermark.h" 7 + 8 + nfit_test_watermark(dax_pmem_core);
+8
tools/testing/nvdimm/dax_pmem_test.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright(c) 2019 Intel Corporation. All rights reserved. 3 + 4 + #include <linux/module.h> 5 + #include <linux/printk.h> 6 + #include "watermark.h" 7 + 8 + nfit_test_watermark(dax_pmem);
+3
tools/testing/nvdimm/test/nfit.c
··· 3171 3171 acpi_nfit_test(); 3172 3172 device_dax_test(); 3173 3173 mcsafe_test(); 3174 + dax_pmem_test(); 3175 + dax_pmem_core_test(); 3176 + dax_pmem_compat_test(); 3174 3177 3175 3178 nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); 3176 3179
+3
tools/testing/nvdimm/watermark.h
··· 6 6 int libnvdimm_test(void); 7 7 int acpi_nfit_test(void); 8 8 int device_dax_test(void); 9 + int dax_pmem_test(void); 10 + int dax_pmem_core_test(void); 11 + int dax_pmem_compat_test(void); 9 12 10 13 /* 11 14 * dummy routine for nfit_test to validate it is linking to the properly