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

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