anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

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

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