krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone

Blame SOURCES/854364ba44aee9bc5646f6537fc744b0b54aff37.patch

f27859
commit 854364ba44aee9bc5646f6537fc744b0b54aff37
f27859
Author: Muralidhara M K <muralimk@amd.com>
f27859
Date:   Thu Aug 20 21:00:57 2020 +0530
f27859
f27859
    rasdaemon: Add 8 channel decoding for SMCA systems
f27859
    
f27859
    Current Scalable Machine Check Architecture (SMCA) systems support up
f27859
    to 8 UMC channels.
f27859
    
f27859
    To find the UMC channel represented by a bank, look at the 6th nibble
f27859
    in the MCA_IPID[InstanceId] field.
f27859
    
f27859
    Signed-off-by: Muralidhara M K <muralimk@amd.com>
f27859
    [ Adjust commit message. ]
f27859
    Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
f27859
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
f27859
f27859
diff --git a/mce-amd-smca.c b/mce-amd-smca.c
f27859
index d0b6cb6..7c619fd 100644
f27859
--- a/mce-amd-smca.c
f27859
+++ b/mce-amd-smca.c
f27859
@@ -438,15 +438,7 @@ static void amd_decode_errcode(struct mce_event *e)
f27859
  */
f27859
 static int find_umc_channel(struct mce_event *e)
f27859
 {
f27859
-	uint32_t umc_instance_id[] = {0x50f00, 0x150f00};
f27859
-	uint32_t instance_id = EXTRACT(e->ipid, 0, 31);
f27859
-	int i, channel = -1;
f27859
-
f27859
-	for (i = 0; i < ARRAY_SIZE(umc_instance_id); i++)
f27859
-		if (umc_instance_id[i] == instance_id)
f27859
-			channel = i;
f27859
-
f27859
-	return channel;
f27859
+	return EXTRACT(e->ipid, 0, 31) >> 20;
f27859
 }
f27859
 /* Decode extended errors according to Scalable MCA specification */
f27859
 static void decode_smca_error(struct mce_event *e)