From 2a1d217660351c08eb2f8bccebf939abba2f7e69 Mon Sep 17 00:00:00 2001 From: "Brian WoodsGhannam, Yazen" Date: Fri, 1 Nov 2019 15:48:13 +0100 Subject: [PATCH] rasdaemon: rename CPU_NAPLES cputype Change CPU_NAPLES to CPU_AMD_SMCA to reflect that it isn't just NAPLES that is supported, but AMD's Scalable Machine Check Architecture (SMCA). [ Yazen: change family check to feature check, and change CPU name. ] CC: "mchehab+samsung@kernel.org" , "Namburu, Chandu-babu" # Thread-Topic: [PATCH 1/2] rasdaemon: rename CPU_NAPLES cputype Signed-off-by: Brian Woods Signed-off-by: Yazen Ghannam Cc: Chandu-babu Namburu Signed-off-by: Mauro Carvalho Chehab --- ras-mce-handler.c | 10 ++++++---- ras-mce-handler.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ras-mce-handler.c b/ras-mce-handler.c index fd3ef3b..016acae 100644 --- a/ras-mce-handler.c +++ b/ras-mce-handler.c @@ -55,7 +55,7 @@ static char *cputype_name[] = { [CPU_KNIGHTS_LANDING] = "Knights Landing", [CPU_KNIGHTS_MILL] = "Knights Mill", [CPU_SKYLAKE_XEON] = "Skylake server", - [CPU_NAPLES] = "AMD Family 17h Zen1", + [CPU_AMD_SMCA] = "AMD Scalable MCA", [CPU_DHYANA] = "Hygon Family 18h Moksha" }; @@ -192,8 +192,10 @@ static int detect_cpu(struct ras_events *ras) if (!strcmp(mce->vendor, "AuthenticAMD")) { if (mce->family == 15) mce->cputype = CPU_K8; - if (mce->family == 23) - mce->cputype = CPU_NAPLES; + if (strstr(mce->processor_flags, "smca")) { + mce->cputype = CPU_AMD_SMCA; + goto ret; + } if (mce->family > 23) { log(ALL, LOG_INFO, "Can't parse MCE for this AMD CPU yet %d\n", @@ -441,7 +443,7 @@ int ras_mce_event_handler(struct trace_seq *s, case CPU_K8: rc = parse_amd_k8_event(ras, &e); break; - case CPU_NAPLES: + case CPU_AMD_SMCA: case CPU_DHYANA: rc = parse_amd_smca_event(ras, &e); break; diff --git a/ras-mce-handler.h b/ras-mce-handler.h index 4d615b4..ec9a076 100644 --- a/ras-mce-handler.h +++ b/ras-mce-handler.h @@ -47,7 +47,7 @@ enum cputype { CPU_KNIGHTS_LANDING, CPU_KNIGHTS_MILL, CPU_SKYLAKE_XEON, - CPU_NAPLES, + CPU_AMD_SMCA, CPU_DHYANA, }; -- 2.50.1