anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

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

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