@@ -87,50 +87,61 @@ struct smca_bank {
8787static DEFINE_PER_CPU_READ_MOSTLY (struct smca_bank [MAX_NR_BANKS ], smca_banks ) ;
8888static DEFINE_PER_CPU_READ_MOSTLY (u8 [N_SMCA_BANK_TYPES ], smca_bank_counts ) ;
8989
90- static const char * const smca_names [] = {
91- [SMCA_LS ... SMCA_LS_V2 ] = "load_store" ,
92- [SMCA_IF ] = "insn_fetch" ,
93- [SMCA_L2_CACHE ] = "l2_cache" ,
94- [SMCA_DE ] = "decode_unit" ,
95- [SMCA_RESERVED ] = "reserved" ,
96- [SMCA_EX ] = "execution_unit" ,
97- [SMCA_FP ] = "floating_point" ,
98- [SMCA_L3_CACHE ] = "l3_cache" ,
99- [SMCA_CS ... SMCA_CS_V2 ] = "coherent_slave" ,
100- [SMCA_PIE ] = "pie" ,
90+ struct smca_bank_name {
91+ const char * name ; /* Short name for sysfs */
92+ const char * long_name ; /* Long name for pretty-printing */
93+ };
94+
95+ static struct smca_bank_name smca_names [] = {
96+ [SMCA_LS ... SMCA_LS_V2 ] = { "load_store" , "Load Store Unit" },
97+ [SMCA_IF ] = { "insn_fetch" , "Instruction Fetch Unit" },
98+ [SMCA_L2_CACHE ] = { "l2_cache" , "L2 Cache" },
99+ [SMCA_DE ] = { "decode_unit" , "Decode Unit" },
100+ [SMCA_RESERVED ] = { "reserved" , "Reserved" },
101+ [SMCA_EX ] = { "execution_unit" , "Execution Unit" },
102+ [SMCA_FP ] = { "floating_point" , "Floating Point Unit" },
103+ [SMCA_L3_CACHE ] = { "l3_cache" , "L3 Cache" },
104+ [SMCA_CS ... SMCA_CS_V2 ] = { "coherent_slave" , "Coherent Slave" },
105+ [SMCA_PIE ] = { "pie" , "Power, Interrupts, etc." },
101106
102107 /* UMC v2 is separate because both of them can exist in a single system. */
103- [SMCA_UMC ] = "umc" ,
104- [SMCA_UMC_V2 ] = "umc_v2" ,
105- [SMCA_MA_LLC ] = "ma_llc" ,
106- [SMCA_PB ] = "param_block" ,
107- [SMCA_PSP ... SMCA_PSP_V2 ] = "psp" ,
108- [SMCA_SMU ... SMCA_SMU_V2 ] = "smu" ,
109- [SMCA_MP5 ] = "mp5" ,
110- [SMCA_MPDMA ] = "mpdma" ,
111- [SMCA_NBIO ] = "nbio" ,
112- [SMCA_PCIE ... SMCA_PCIE_V2 ] = "pcie" ,
113- [SMCA_XGMI_PCS ] = "xgmi_pcs" ,
114- [SMCA_NBIF ] = "nbif" ,
115- [SMCA_SHUB ] = "shub" ,
116- [SMCA_SATA ] = "sata" ,
117- [SMCA_USB ] = "usb" ,
118- [SMCA_USR_DP ] = "usr_dp" ,
119- [SMCA_USR_CP ] = "usr_cp" ,
120- [SMCA_GMI_PCS ] = "gmi_pcs" ,
121- [SMCA_XGMI_PHY ] = "xgmi_phy" ,
122- [SMCA_WAFL_PHY ] = "wafl_phy" ,
123- [SMCA_GMI_PHY ] = "gmi_phy" ,
108+ [SMCA_UMC ] = { "umc" , "Unified Memory Controller" },
109+ [SMCA_UMC_V2 ] = { "umc_v2" , "Unified Memory Controller v2" },
110+ [SMCA_PB ] = { "param_block" , "Parameter Block" },
111+ [SMCA_PSP ... SMCA_PSP_V2 ] = { "psp" , "Platform Security Processor" },
112+ [SMCA_SMU ... SMCA_SMU_V2 ] = { "smu" , "System Management Unit" },
113+ [SMCA_MP5 ] = { "mp5" , "Microprocessor 5 Unit" },
114+ [SMCA_MPDMA ] = { "mpdma" , "MPDMA Unit" },
115+ [SMCA_NBIO ] = { "nbio" , "Northbridge IO Unit" },
116+ [SMCA_PCIE ... SMCA_PCIE_V2 ] = { "pcie" , "PCI Express Unit" },
117+ [SMCA_XGMI_PCS ] = { "xgmi_pcs" , "Ext Global Memory Interconnect PCS Unit" },
118+ [SMCA_NBIF ] = { "nbif" , "NBIF Unit" },
119+ [SMCA_SHUB ] = { "shub" , "System Hub Unit" },
120+ [SMCA_SATA ] = { "sata" , "SATA Unit" },
121+ [SMCA_USB ] = { "usb" , "USB Unit" },
122+ [SMCA_GMI_PCS ] = { "gmi_pcs" , "Global Memory Interconnect PCS Unit" },
123+ [SMCA_XGMI_PHY ] = { "xgmi_phy" , "Ext Global Memory Interconnect PHY Unit" },
124+ [SMCA_WAFL_PHY ] = { "wafl_phy" , "WAFL PHY Unit" },
125+ [SMCA_GMI_PHY ] = { "gmi_phy" , "Global Memory Interconnect PHY Unit" },
124126};
125127
126128static const char * smca_get_name (enum smca_bank_types t )
127129{
128130 if (t >= N_SMCA_BANK_TYPES )
129131 return NULL ;
130132
131- return smca_names [t ];
133+ return smca_names [t ]. name ;
132134}
133135
136+ const char * smca_get_long_name (enum smca_bank_types t )
137+ {
138+ if (t >= N_SMCA_BANK_TYPES )
139+ return NULL ;
140+
141+ return smca_names [t ].long_name ;
142+ }
143+ EXPORT_SYMBOL_GPL (smca_get_long_name );
144+
134145enum smca_bank_types smca_get_bank_type (unsigned int cpu , unsigned int bank )
135146{
136147 struct smca_bank * b ;
@@ -167,7 +178,6 @@ static const struct smca_hwid smca_hwid_mcatypes[] = {
167178 { SMCA_CS , HWID_MCATYPE (0x2E , 0x0 ) },
168179 { SMCA_PIE , HWID_MCATYPE (0x2E , 0x1 ) },
169180 { SMCA_CS_V2 , HWID_MCATYPE (0x2E , 0x2 ) },
170- { SMCA_MA_LLC , HWID_MCATYPE (0x2E , 0x4 ) },
171181
172182 /* Unified Memory Controller MCA type */
173183 { SMCA_UMC , HWID_MCATYPE (0x96 , 0x0 ) },
@@ -202,8 +212,6 @@ static const struct smca_hwid smca_hwid_mcatypes[] = {
202212 { SMCA_SHUB , HWID_MCATYPE (0x80 , 0x0 ) },
203213 { SMCA_SATA , HWID_MCATYPE (0xA8 , 0x0 ) },
204214 { SMCA_USB , HWID_MCATYPE (0xAA , 0x0 ) },
205- { SMCA_USR_DP , HWID_MCATYPE (0x170 , 0x0 ) },
206- { SMCA_USR_CP , HWID_MCATYPE (0x180 , 0x0 ) },
207215 { SMCA_GMI_PCS , HWID_MCATYPE (0x241 , 0x0 ) },
208216 { SMCA_XGMI_PHY , HWID_MCATYPE (0x259 , 0x0 ) },
209217 { SMCA_WAFL_PHY , HWID_MCATYPE (0x267 , 0x0 ) },
@@ -707,13 +715,11 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
707715
708716bool amd_mce_is_memory_error (struct mce * m )
709717{
710- enum smca_bank_types bank_type ;
711718 /* ErrCodeExt[20:16] */
712719 u8 xec = (m -> status >> 16 ) & 0x1f ;
713720
714- bank_type = smca_get_bank_type (m -> extcpu , m -> bank );
715721 if (mce_flags .smca )
716- return ( bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2 ) && xec == 0x0 ;
722+ return smca_get_bank_type ( m -> extcpu , m -> bank ) == SMCA_UMC && xec == 0x0 ;
717723
718724 return m -> bank == 4 && xec == 0x8 ;
719725}
@@ -1043,7 +1049,7 @@ static const char *get_name(unsigned int cpu, unsigned int bank, struct threshol
10431049 if (bank_type >= N_SMCA_BANK_TYPES )
10441050 return NULL ;
10451051
1046- if (b && ( bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2 ) ) {
1052+ if (b && bank_type == SMCA_UMC ) {
10471053 if (b -> block < ARRAY_SIZE (smca_umc_block_names ))
10481054 return smca_umc_block_names [b -> block ];
10491055 return NULL ;
0 commit comments