Blame SOURCES/854364ba44aee9bc5646f6537fc744b0b54aff37.patch

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