ndctl/0020-papr-Add-support-to-parse-save_fail-flag-for-dimm.patch

42 lines
1.4 KiB
Diff
Raw Normal View History

From f081f302505209430df46908775a3cffb875a5c7 Mon Sep 17 00:00:00 2001
From: Santosh Sivaraj <santosh@fossix.org>
Date: Thu, 13 May 2021 11:42:17 +0530
Subject: [PATCH 020/217] papr: Add support to parse save_fail flag for dimm
This will help in getting the dimm fail tests to run on papr family too.
Also add nvdimm_test compatibility string for recognizing the test module.
Link: https://lore.kernel.org/r/20210513061218.760322-3-santosh@fossix.org
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
ndctl/lib/libndctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index e45353f..a8b99ea 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -805,6 +805,8 @@ static void parse_papr_flags(struct ndctl_dimm *dimm, char *flags)
dimm->flags.f_restore = 1;
else if (strcmp(start, "smart_notify") == 0)
dimm->flags.f_smart = 1;
+ else if (strcmp(start, "save_fail") == 0)
+ dimm->flags.f_save = 1;
start = end + 1;
}
if (end != start)
@@ -1035,7 +1037,8 @@ NDCTL_EXPORT int ndctl_bus_is_papr_scm(struct ndctl_bus *bus)
if (sysfs_read_attr(bus->ctx, bus->bus_buf, buf) < 0)
return 0;
- return (strcmp(buf, "ibm,pmemory") == 0);
+ return (strcmp(buf, "ibm,pmemory") == 0 ||
+ strcmp(buf, "nvdimm_test") == 0);
}
/**
--
2.27.0