On Thu, Oct 5, 2017 at 6:53 PM, Vishal Verma <vishal.l.verma(a)intel.com> wrote:
From: Dave Jiang <dave.jiang(a)intel.com>
From: Dave Jiang <dave.jiang(a)intel.com>
Add nfit_test emulation for the new ACPI 6.2 error injectino DSMs.
This will allow unit tests to selectively inject the errors they wish to
test for.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
[vishal: Add badrange.o to nfit_test's Kbuild]
[vishal: Move injection functions to ND_CMD_CALL]
[vishal: Add support for the notification option]
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
drivers/acpi/nfit/nfit.h | 1 +
tools/testing/nvdimm/Kbuild | 1 +
tools/testing/nvdimm/test/nfit.c | 187 +++++++++++++++++++++++++++++-----
tools/testing/nvdimm/test/nfit_test.h | 4 +
4 files changed, 169 insertions(+), 24 deletions(-)
diff --git a/drivers/acpi/nfit/nfit.h b/drivers/acpi/nfit/nfit.h
index 7093bd5..7ddf48f 100644
--- a/drivers/acpi/nfit/nfit.h
+++ b/drivers/acpi/nfit/nfit.h
@@ -75,6 +75,7 @@ enum {
NFIT_ARS_CAP_NONE = 1,
NFIT_ARS_F_OVERFLOW = 1,
NFIT_ARS_TIMEOUT = 90,
+ NFIT_ARS_INJECT_INVALID = 2,
If there is no usage of this define outside of nfit_test then it
should be defined in tools/testing/nvdimm/test/nfit.h.
};
enum nfit_root_notifiers {
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index d870520..3272ab5 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -69,6 +69,7 @@ libnvdimm-y += $(NVDIMM_SRC)/region_devs.o
libnvdimm-y += $(NVDIMM_SRC)/region.o
libnvdimm-y += $(NVDIMM_SRC)/namespace_devs.o
libnvdimm-y += $(NVDIMM_SRC)/label.o
+libnvdimm-y += $(NVDIMM_SRC)/badrange.o
This hunk should go in the same patch that changes
drivers/nvdimm/Makefile to add badrange.o so we don't have an
nfit_test compile breakage gap between commits.