Skip to content

Commit 92f6f2d

Browse files
stellarhopperdjbw
authored andcommitted
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 <[email protected]> Signed-off-by: Vishal Verma <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent d521fba commit 92f6f2d

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

tools/testing/nvdimm/Kbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ device_dax-y += device_dax_test.o
6868
device_dax-y += config_check.o
6969

7070
dax_pmem-y := $(DAX_SRC)/pmem/pmem.o
71+
dax_pmem-y += dax_pmem_test.o
7172
dax_pmem_core-y := $(DAX_SRC)/pmem/core.o
73+
dax_pmem_core-y += dax_pmem_core_test.o
7274
dax_pmem_compat-y := $(DAX_SRC)/pmem/compat.o
75+
dax_pmem_compat-y += dax_pmem_compat_test.o
7376
dax_pmem-y += config_check.o
7477

7578
libnvdimm-y := $(NVDIMM_SRC)/core.o
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

tools/testing/nvdimm/test/nfit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,9 @@ static __init int nfit_test_init(void)
31713171
acpi_nfit_test();
31723172
device_dax_test();
31733173
mcsafe_test();
3174+
dax_pmem_test();
3175+
dax_pmem_core_test();
3176+
dax_pmem_compat_test();
31743177

31753178
nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm);
31763179

tools/testing/nvdimm/watermark.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ int pmem_test(void);
66
int libnvdimm_test(void);
77
int acpi_nfit_test(void);
88
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);
912

1013
/*
1114
* dummy routine for nfit_test to validate it is linking to the properly

0 commit comments

Comments
 (0)