anitazha / rpms / ndctl

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