From f110176633d74bbac1f80ab9b9c6b83ea3e1cc23 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 17 Oct 2018 10:47:19 -0700 Subject: tools/testing/nvdimm: Populate dirty shutdown data Allow the unit tests to verify the retrieval of the dirty shutdown count via smart commands, and allow the driver-load-time retrieval of the smart health payload to be simulated by nfit_test. Reviewed-by: Keith Busch Signed-off-by: Dan Williams --- drivers/acpi/nfit/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index bf7021bb276c..ec8fb578fa36 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1721,7 +1721,7 @@ static bool acpi_nvdimm_has_method(struct acpi_device *adev, char *method) return false; } -static void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem) +__weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem) { struct nd_intel_smart smart = { 0 }; union acpi_object in_buf = { @@ -1785,8 +1785,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en; nfit_mem->family = NVDIMM_FAMILY_INTEL; adev = to_acpi_dev(acpi_desc); - if (!adev) + if (!adev) { + /* unit test case */ + populate_shutdown_status(nfit_mem); return 0; + } adev_dimm = acpi_find_child_device(adev, device_handle, false); nfit_mem->adev = adev_dimm; -- cgit v1.2.3-58-ga151