]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/kernel/cpu/mcheck/mce_amd.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / arch / x86 / kernel / cpu / mcheck / mce_amd.c
index a5fd137417a27278f49f3cf0b60803997176a665..9e5427df3243430a752e4f1425d906de45a458e7 100644 (file)
@@ -192,6 +192,7 @@ static void get_smca_bank_info(unsigned int bank)
 
                        smca_banks[bank].hwid = s_hwid;
                        smca_banks[bank].id = instance_id;
+                       smca_banks[bank].sysfs_id = s_hwid->count++;
                        break;
                }
        }
@@ -777,7 +778,8 @@ __log_error(unsigned int bank, bool deferred_err, bool threshold_err, u64 misc)
        mce_setup(&m);
 
        m.status = status;
-       m.bank = bank;
+       m.bank   = bank;
+       m.tsc    = rdtsc();
 
        if (threshold_err)
                m.misc = misc;
@@ -1064,9 +1066,12 @@ static const char *get_name(unsigned int bank, struct threshold_block *b)
                return NULL;
        }
 
+       if (smca_banks[bank].hwid->count == 1)
+               return smca_get_name(bank_type);
+
        snprintf(buf_mcatype, MAX_MCATYPE_NAME_LEN,
                 "%s_%x", smca_get_name(bank_type),
-                         smca_banks[bank].id);
+                         smca_banks[bank].sysfs_id);
        return buf_mcatype;
 }