Blame SOURCES/854364ba44aee9bc5646f6537fc744b0b54aff37.patch

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