Blame SOURCES/9acef39f13833f7d53ef96abc5a72e79384260f4.patch

9fadc0
commit 9acef39f13833f7d53ef96abc5a72e79384260f4
9fadc0
Author: Naveen Krishna Chatradhi <nchatrad@amd.com>
9fadc0
Date:   Tue Jun 1 11:01:17 2021 +0530
9fadc0
9fadc0
    rasdaemon: Add new SMCA bank types with error decoding
9fadc0
    
9fadc0
    Upcoming systems with Scalable Machine Check Architecture (SMCA) have
9fadc0
    new MCA banks added.
9fadc0
    
9fadc0
    This patch adds the (HWID, MCATYPE) tuple, name and error decoding for
9fadc0
    those new SMCA banks.
9fadc0
    While at it, optimize the string names in smca_bank_name[].
9fadc0
    
9fadc0
    Signed-off-by: Muralidhara M K <muralimk@amd.com>
9fadc0
    Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
9fadc0
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
9fadc0
9fadc0
diff --git a/mce-amd-smca.c b/mce-amd-smca.c
9fadc0
index 7c619fd..e0cf512 100644
9fadc0
--- a/mce-amd-smca.c
9fadc0
+++ b/mce-amd-smca.c
9fadc0
@@ -47,7 +47,7 @@
9fadc0
 /* These may be used by multiple smca_hwid_mcatypes */
9fadc0
 enum smca_bank_types {
9fadc0
 	SMCA_LS = 0,    /* Load Store */
9fadc0
-	SMCA_LS_V2,	/* Load Store */
9fadc0
+	SMCA_LS_V2,
9fadc0
 	SMCA_IF,        /* Instruction Fetch */
9fadc0
 	SMCA_L2_CACHE,  /* L2 Cache */
9fadc0
 	SMCA_DE,        /* Decoder Unit */
9fadc0
@@ -56,17 +56,22 @@ enum smca_bank_types {
9fadc0
 	SMCA_FP,        /* Floating Point */
9fadc0
 	SMCA_L3_CACHE,  /* L3 Cache */
9fadc0
 	SMCA_CS,        /* Coherent Slave */
9fadc0
-	SMCA_CS_V2,     /* Coherent Slave V2 */
9fadc0
+	SMCA_CS_V2,
9fadc0
 	SMCA_PIE,       /* Power, Interrupts, etc. */
9fadc0
 	SMCA_UMC,       /* Unified Memory Controller */
9fadc0
+	SMCA_UMC_V2,
9fadc0
 	SMCA_PB,        /* Parameter Block */
9fadc0
 	SMCA_PSP,       /* Platform Security Processor */
9fadc0
-	SMCA_PSP_V2,    /* Platform Security Processor V2 */
9fadc0
+	SMCA_PSP_V2,
9fadc0
 	SMCA_SMU,       /* System Management Unit */
9fadc0
-	SMCA_SMU_V2,    /* System Management Unit V2 */
9fadc0
+	SMCA_SMU_V2,
9fadc0
 	SMCA_MP5,	/* Microprocessor 5 Unit */
9fadc0
 	SMCA_NBIO,	/* Northbridge IO Unit */
9fadc0
 	SMCA_PCIE,	/* PCI Express Unit */
9fadc0
+	SMCA_PCIE_V2,
9fadc0
+	SMCA_XGMI_PCS,	/* xGMI PCS Unit */
9fadc0
+	SMCA_XGMI_PHY,	/* xGMI PHY Unit */
9fadc0
+	SMCA_WAFL_PHY,	/* WAFL PHY Unit */
9fadc0
 	N_SMCA_BANK_TYPES
9fadc0
 };
9fadc0
 
9fadc0
@@ -237,6 +242,22 @@ static const char * const smca_umc_mce_desc[] = {
9fadc0
 	"Command/address parity error",
9fadc0
 	"Write data CRC error",
9fadc0
 };
9fadc0
+
9fadc0
+static const char * const smca_umc2_mce_desc[] = {
9fadc0
+	"DRAM ECC error",
9fadc0
+	"Data poison error",
9fadc0
+	"SDP parity error",
9fadc0
+	"Reserved",
9fadc0
+	"Address/Command parity error",
9fadc0
+	"Write data parity error",
9fadc0
+	"DCQ SRAM ECC error",
9fadc0
+	"Reserved",
9fadc0
+	"Read data parity error",
9fadc0
+	"Rdb SRAM ECC error",
9fadc0
+	"RdRsp SRAM ECC error",
9fadc0
+	"LM32 MP errors",
9fadc0
+};
9fadc0
+
9fadc0
 /* Parameter Block */
9fadc0
 static const char * const smca_pb_mce_desc[] = {
9fadc0
 	"Parameter Block RAM ECC error",
9fadc0
@@ -314,6 +335,55 @@ static const char * const smca_pcie_mce_desc[] = {
9fadc0
 	"CCIX Non-okay write response with data error",
9fadc0
 };
9fadc0
 
9fadc0
+static const char * const smca_pcie2_mce_desc[] = {
9fadc0
+	"SDP Parity Error logging",
9fadc0
+};
9fadc0
+
9fadc0
+static const char * const smca_xgmipcs_mce_desc[] = {
9fadc0
+	"Data Loss Error",
9fadc0
+	"Training Error",
9fadc0
+	"Flow Control Acknowledge Error",
9fadc0
+	"Rx Fifo Underflow Error",
9fadc0
+	"Rx Fifo Overflow Error",
9fadc0
+	"CRC Error",
9fadc0
+	"BER Exceeded Error",
9fadc0
+	"Tx Vcid Data Error",
9fadc0
+	"Replay Buffer Parity Error",
9fadc0
+	"Data Parity Error",
9fadc0
+	"Replay Fifo Overflow Error",
9fadc0
+	"Replay Fifo Underflow Error",
9fadc0
+	"Elastic Fifo Overflow Error",
9fadc0
+	"Deskew Error",
9fadc0
+	"Flow Control CRC Error",
9fadc0
+	"Data Startup Limit Error",
9fadc0
+	"FC Init Timeout Error",
9fadc0
+	"Recovery Timeout Error",
9fadc0
+	"Ready Serial Timeout Error",
9fadc0
+	"Ready Serial Attempt Error",
9fadc0
+	"Recovery Attempt Error",
9fadc0
+	"Recovery Relock Attempt Error",
9fadc0
+	"Replay Attempt Error",
9fadc0
+	"Sync Header Error",
9fadc0
+	"Tx Replay Timeout Error",
9fadc0
+	"Rx Replay Timeout Error",
9fadc0
+	"LinkSub Tx Timeout Error",
9fadc0
+	"LinkSub Rx Timeout Error",
9fadc0
+	"Rx CMD Pocket Error",
9fadc0
+};
9fadc0
+
9fadc0
+static const char * const smca_xgmiphy_mce_desc[] = {
9fadc0
+	"RAM ECC Error",
9fadc0
+	"ARC instruction buffer parity error",
9fadc0
+	"ARC data buffer parity error",
9fadc0
+	"PHY APB error",
9fadc0
+};
9fadc0
+
9fadc0
+static const char * const smca_waflphy_mce_desc[] = {
9fadc0
+	"RAM ECC Error",
9fadc0
+	"ARC instruction buffer parity error",
9fadc0
+	"ARC data buffer parity error",
9fadc0
+	"PHY APB error",
9fadc0
+};
9fadc0
 
9fadc0
 struct smca_mce_desc {
9fadc0
 	const char * const *descs;
9fadc0
@@ -333,6 +403,7 @@ static struct smca_mce_desc smca_mce_descs[] = {
9fadc0
 	[SMCA_CS_V2]    = { smca_cs2_mce_desc,  ARRAY_SIZE(smca_cs2_mce_desc) },
9fadc0
 	[SMCA_PIE]      = { smca_pie_mce_desc,  ARRAY_SIZE(smca_pie_mce_desc) },
9fadc0
 	[SMCA_UMC]      = { smca_umc_mce_desc,  ARRAY_SIZE(smca_umc_mce_desc) },
9fadc0
+	[SMCA_UMC_V2]	= { smca_umc2_mce_desc,	ARRAY_SIZE(smca_umc2_mce_desc)	},
9fadc0
 	[SMCA_PB]       = { smca_pb_mce_desc,   ARRAY_SIZE(smca_pb_mce_desc)  },
9fadc0
 	[SMCA_PSP]      = { smca_psp_mce_desc,  ARRAY_SIZE(smca_psp_mce_desc) },
9fadc0
 	[SMCA_PSP_V2]   = { smca_psp2_mce_desc, ARRAY_SIZE(smca_psp2_mce_desc)},
9fadc0
@@ -341,6 +412,10 @@ static struct smca_mce_desc smca_mce_descs[] = {
9fadc0
 	[SMCA_MP5]      = { smca_mp5_mce_desc,  ARRAY_SIZE(smca_mp5_mce_desc) },
9fadc0
 	[SMCA_NBIO]     = { smca_nbio_mce_desc, ARRAY_SIZE(smca_nbio_mce_desc)},
9fadc0
 	[SMCA_PCIE]     = { smca_pcie_mce_desc, ARRAY_SIZE(smca_pcie_mce_desc)},
9fadc0
+	[SMCA_PCIE_V2]	= { smca_pcie2_mce_desc,   ARRAY_SIZE(smca_pcie2_mce_desc)	},
9fadc0
+	[SMCA_XGMI_PCS]	= { smca_xgmipcs_mce_desc, ARRAY_SIZE(smca_xgmipcs_mce_desc)	},
9fadc0
+	[SMCA_XGMI_PHY]	= { smca_xgmiphy_mce_desc, ARRAY_SIZE(smca_xgmiphy_mce_desc)	},
9fadc0
+	[SMCA_WAFL_PHY]	= { smca_waflphy_mce_desc, ARRAY_SIZE(smca_waflphy_mce_desc)	},
9fadc0
 };
9fadc0
 
9fadc0
 struct smca_hwid {
9fadc0
@@ -369,6 +444,8 @@ static struct smca_hwid smca_hwid_mcatypes[] = {
9fadc0
 
9fadc0
 	/* Unified Memory Controller MCA type */
9fadc0
 	{ SMCA_UMC,      0x00000096 },
9fadc0
+	/* Heterogeneous systems may have both UMC and UMC_v2 types on the same node. */
9fadc0
+	{ SMCA_UMC_V2,   0x00010096 },
9fadc0
 
9fadc0
 	/* Parameter Block MCA type */
9fadc0
 	{ SMCA_PB,       0x00000005 },
9fadc0
@@ -389,6 +466,16 @@ static struct smca_hwid smca_hwid_mcatypes[] = {
9fadc0
 
9fadc0
 	/* PCI Express Unit MCA type */
9fadc0
 	{ SMCA_PCIE,     0x00000046 },
9fadc0
+	{ SMCA_PCIE_V2,  0x00010046 },
9fadc0
+
9fadc0
+	/* Ext Global Memory Interconnect PCS MCA type */
9fadc0
+	{ SMCA_XGMI_PCS, 0x00000050 },
9fadc0
+
9fadc0
+	/* Ext Global Memory Interconnect PHY MCA type */
9fadc0
+	{ SMCA_XGMI_PHY, 0x00000259 },
9fadc0
+
9fadc0
+	/* WAFL PHY MCA type */
9fadc0
+	{ SMCA_WAFL_PHY, 0x00000267 },
9fadc0
 };
9fadc0
 
9fadc0
 struct smca_bank_name {
9fadc0
@@ -396,27 +483,28 @@ struct smca_bank_name {
9fadc0
 };
9fadc0
 
9fadc0
 static struct smca_bank_name smca_names[] = {
9fadc0
-	[SMCA_LS]       = { "Load Store Unit" },
9fadc0
-	[SMCA_LS_V2]    = { "Load Store Unit" },
9fadc0
-	[SMCA_IF]       = { "Instruction Fetch Unit" },
9fadc0
-	[SMCA_L2_CACHE] = { "L2 Cache" },
9fadc0
-	[SMCA_DE]       = { "Decode Unit" },
9fadc0
-	[SMCA_RESERVED] = { "Reserved" },
9fadc0
-	[SMCA_EX]       = { "Execution Unit" },
9fadc0
-	[SMCA_FP]       = { "Floating Point Unit" },
9fadc0
-	[SMCA_L3_CACHE] = { "L3 Cache" },
9fadc0
-	[SMCA_CS]       = { "Coherent Slave" },
9fadc0
-	[SMCA_CS_V2]    = { "Coherent Slave" },
9fadc0
-	[SMCA_PIE]      = { "Power, Interrupts, etc." },
9fadc0
-	[SMCA_UMC]      = { "Unified Memory Controller" },
9fadc0
-	[SMCA_PB]       = { "Parameter Block" },
9fadc0
-	[SMCA_PSP]      = { "Platform Security Processor" },
9fadc0
-	[SMCA_PSP_V2]   = { "Platform Security Processor" },
9fadc0
-	[SMCA_SMU]      = { "System Management Unit" },
9fadc0
-	[SMCA_SMU_V2]   = { "System Management Unit" },
9fadc0
-	[SMCA_MP5]	= { "Microprocessor 5 Unit" },
9fadc0
-	[SMCA_NBIO]     = { "Northbridge IO Unit" },
9fadc0
-	[SMCA_PCIE]     = { "PCI Express Unit" },
9fadc0
+	[SMCA_LS ... SMCA_LS_V2]	= { "Load Store Unit" },
9fadc0
+	[SMCA_IF]			= { "Instruction Fetch Unit" },
9fadc0
+	[SMCA_L2_CACHE]			= { "L2 Cache" },
9fadc0
+	[SMCA_DE]			= { "Decode Unit" },
9fadc0
+	[SMCA_RESERVED]			= { "Reserved" },
9fadc0
+	[SMCA_EX]			= { "Execution Unit" },
9fadc0
+	[SMCA_FP]			= { "Floating Point Unit" },
9fadc0
+	[SMCA_L3_CACHE]			= { "L3 Cache" },
9fadc0
+	[SMCA_CS ... SMCA_CS_V2]	= { "Coherent Slave" },
9fadc0
+	[SMCA_PIE]			= { "Power, Interrupts, etc." },
9fadc0
+	[SMCA_UMC]			= { "Unified Memory Controller" },
9fadc0
+	[SMCA_UMC_V2]			= { "Unified Memory Controller V2" },
9fadc0
+	[SMCA_PB]			= { "Parameter Block" },
9fadc0
+	[SMCA_PSP ... SMCA_PSP_V2]	= { "Platform Security Processor" },
9fadc0
+	[SMCA_SMU ... SMCA_SMU_V2]	= { "System Management Unit" },
9fadc0
+	[SMCA_MP5]			= { "Microprocessor 5 Unit" },
9fadc0
+	[SMCA_NBIO]			= { "Northbridge IO Unit" },
9fadc0
+	[SMCA_PCIE ... SMCA_PCIE_V2]	= { "PCI Express Unit" },
9fadc0
+	[SMCA_XGMI_PCS]			= { "Ext Global Memory Interconnect PCS Unit" },
9fadc0
+	[SMCA_XGMI_PHY]			= { "Ext Global Memory Interconnect PHY Unit" },
9fadc0
+	[SMCA_WAFL_PHY]			= { "WAFL PHY Unit" },
9fadc0
+
9fadc0
 };
9fadc0
 
9fadc0
 static void amd_decode_errcode(struct mce_event *e)