diff options
| author | Vishal Verma <vishal.l.verma@intel.com> | 2019-03-18 21:06:29 -0400 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2019-04-22 18:56:28 -0400 |
| commit | 92f6f2d7f5c844faebf5b47d4a8f15de519b48c2 (patch) | |
| tree | 4c31d67c62837785990c96e6dd6edc8bf26fcd72 | |
| parent | d521fbaeda726ef3a9dad91c0239e7207d9864b7 (diff) | |
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>
| -rw-r--r-- | tools/testing/nvdimm/Kbuild | 3 | ||||
| -rw-r--r-- | tools/testing/nvdimm/dax_pmem_compat_test.c | 8 | ||||
| -rw-r--r-- | tools/testing/nvdimm/dax_pmem_core_test.c | 8 | ||||
| -rw-r--r-- | tools/testing/nvdimm/dax_pmem_test.c | 8 | ||||
| -rw-r--r-- | tools/testing/nvdimm/test/nfit.c | 3 | ||||
| -rw-r--r-- | tools/testing/nvdimm/watermark.h | 3 |
6 files changed, 33 insertions, 0 deletions
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index e1286d2cdfbf..c4a9196d794c 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild | |||
| @@ -68,8 +68,11 @@ device_dax-y += device_dax_test.o | |||
| 68 | device_dax-y += config_check.o | 68 | device_dax-y += config_check.o |
| 69 | 69 | ||
| 70 | dax_pmem-y := $(DAX_SRC)/pmem/pmem.o | 70 | dax_pmem-y := $(DAX_SRC)/pmem/pmem.o |
| 71 | dax_pmem-y += dax_pmem_test.o | ||
| 71 | dax_pmem_core-y := $(DAX_SRC)/pmem/core.o | 72 | dax_pmem_core-y := $(DAX_SRC)/pmem/core.o |
| 73 | dax_pmem_core-y += dax_pmem_core_test.o | ||
| 72 | dax_pmem_compat-y := $(DAX_SRC)/pmem/compat.o | 74 | dax_pmem_compat-y := $(DAX_SRC)/pmem/compat.o |
| 75 | dax_pmem_compat-y += dax_pmem_compat_test.o | ||
| 73 | dax_pmem-y += config_check.o | 76 | dax_pmem-y += config_check.o |
| 74 | 77 | ||
| 75 | libnvdimm-y := $(NVDIMM_SRC)/core.o | 78 | libnvdimm-y := $(NVDIMM_SRC)/core.o |
diff --git a/tools/testing/nvdimm/dax_pmem_compat_test.c b/tools/testing/nvdimm/dax_pmem_compat_test.c new file mode 100644 index 000000000000..7cd1877f3765 --- /dev/null +++ b/tools/testing/nvdimm/dax_pmem_compat_test.c | |||
| @@ -0,0 +1,8 @@ | |||
| 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); | ||
diff --git a/tools/testing/nvdimm/dax_pmem_core_test.c b/tools/testing/nvdimm/dax_pmem_core_test.c new file mode 100644 index 000000000000..a4249cdbeec1 --- /dev/null +++ b/tools/testing/nvdimm/dax_pmem_core_test.c | |||
| @@ -0,0 +1,8 @@ | |||
| 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); | ||
diff --git a/tools/testing/nvdimm/dax_pmem_test.c b/tools/testing/nvdimm/dax_pmem_test.c new file mode 100644 index 000000000000..fd4c94a5aa02 --- /dev/null +++ b/tools/testing/nvdimm/dax_pmem_test.c | |||
| @@ -0,0 +1,8 @@ | |||
| 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); | ||
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index 85ffdcfa596b..bb4225cdf666 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c | |||
| @@ -3171,6 +3171,9 @@ static __init int nfit_test_init(void) | |||
| 3171 | acpi_nfit_test(); | 3171 | acpi_nfit_test(); |
| 3172 | device_dax_test(); | 3172 | device_dax_test(); |
| 3173 | mcsafe_test(); | 3173 | mcsafe_test(); |
| 3174 | dax_pmem_test(); | ||
| 3175 | dax_pmem_core_test(); | ||
| 3176 | dax_pmem_compat_test(); | ||
| 3174 | 3177 | ||
| 3175 | nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); | 3178 | nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm); |
| 3176 | 3179 | ||
diff --git a/tools/testing/nvdimm/watermark.h b/tools/testing/nvdimm/watermark.h index ed0528757bd4..43fc4f3e7927 100644 --- a/tools/testing/nvdimm/watermark.h +++ b/tools/testing/nvdimm/watermark.h | |||
| @@ -6,6 +6,9 @@ int pmem_test(void); | |||
| 6 | int libnvdimm_test(void); | 6 | int libnvdimm_test(void); |
| 7 | int acpi_nfit_test(void); | 7 | int acpi_nfit_test(void); |
| 8 | int device_dax_test(void); | 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 | * dummy routine for nfit_test to validate it is linking to the properly | 14 | * dummy routine for nfit_test to validate it is linking to the properly |
