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

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