aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/mce_amd.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 30f7309446a6..51b9caa0b024 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -741,6 +741,36 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
741 if (amd_filter_mce(m)) 741 if (amd_filter_mce(m))
742 return NOTIFY_STOP; 742 return NOTIFY_STOP;
743 743
744 pr_emerg(HW_ERR "%s\n", decode_error_status(m));
745
746 pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s",
747 m->extcpu,
748 c->x86, c->x86_model, c->x86_mask,
749 m->bank,
750 ((m->status & MCI_STATUS_OVER) ? "Over" : "-"),
751 ((m->status & MCI_STATUS_UC) ? "UE" : "CE"),
752 ((m->status & MCI_STATUS_MISCV) ? "MiscV" : "-"),
753 ((m->status & MCI_STATUS_PCC) ? "PCC" : "-"),
754 ((m->status & MCI_STATUS_ADDRV) ? "AddrV" : "-"));
755
756 if (c->x86 == 0x15 || c->x86 == 0x16)
757 pr_cont("|%s|%s",
758 ((m->status & MCI_STATUS_DEFERRED) ? "Deferred" : "-"),
759 ((m->status & MCI_STATUS_POISON) ? "Poison" : "-"));
760
761 /* do the two bits[14:13] together */
762 ecc = (m->status >> 45) & 0x3;
763 if (ecc)
764 pr_cont("|%sECC", ((ecc == 2) ? "C" : "U"));
765
766 pr_cont("]: 0x%016llx\n", m->status);
767
768 if (m->status & MCI_STATUS_ADDRV)
769 pr_emerg(HW_ERR "MC%d_ADDR: 0x%016llx\n", m->bank, m->addr);
770
771 if (!fam_ops)
772 goto err_code;
773
744 switch (m->bank) { 774 switch (m->bank) {
745 case 0: 775 case 0:
746 decode_mc0_mce(m); 776 decode_mc0_mce(m);
@@ -774,33 +804,7 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
774 break; 804 break;
775 } 805 }
776 806
777 pr_emerg(HW_ERR "Error Status: %s\n", decode_error_status(m)); 807 err_code:
778
779 pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s",
780 m->extcpu,
781 c->x86, c->x86_model, c->x86_mask,
782 m->bank,
783 ((m->status & MCI_STATUS_OVER) ? "Over" : "-"),
784 ((m->status & MCI_STATUS_UC) ? "UE" : "CE"),
785 ((m->status & MCI_STATUS_MISCV) ? "MiscV" : "-"),
786 ((m->status & MCI_STATUS_PCC) ? "PCC" : "-"),
787 ((m->status & MCI_STATUS_ADDRV) ? "AddrV" : "-"));
788
789 if (c->x86 == 0x15 || c->x86 == 0x16)
790 pr_cont("|%s|%s",
791 ((m->status & MCI_STATUS_DEFERRED) ? "Deferred" : "-"),
792 ((m->status & MCI_STATUS_POISON) ? "Poison" : "-"));
793
794 /* do the two bits[14:13] together */
795 ecc = (m->status >> 45) & 0x3;
796 if (ecc)
797 pr_cont("|%sECC", ((ecc == 2) ? "C" : "U"));
798
799 pr_cont("]: 0x%016llx\n", m->status);
800
801 if (m->status & MCI_STATUS_ADDRV)
802 pr_emerg(HW_ERR "MC%d_ADDR: 0x%016llx\n", m->bank, m->addr);
803
804 amd_decode_err_code(m->status & 0xffff); 808 amd_decode_err_code(m->status & 0xffff);
805 809
806 return NOTIFY_STOP; 810 return NOTIFY_STOP;
@@ -816,10 +820,7 @@ static int __init mce_amd_init(void)
816 struct cpuinfo_x86 *c = &boot_cpu_data; 820 struct cpuinfo_x86 *c = &boot_cpu_data;
817 821
818 if (c->x86_vendor != X86_VENDOR_AMD) 822 if (c->x86_vendor != X86_VENDOR_AMD)
819 return 0; 823 return -ENODEV;
820
821 if (c->x86 < 0xf || c->x86 > 0x16)
822 return 0;
823 824
824 fam_ops = kzalloc(sizeof(struct amd_decoder_ops), GFP_KERNEL); 825 fam_ops = kzalloc(sizeof(struct amd_decoder_ops), GFP_KERNEL);
825 if (!fam_ops) 826 if (!fam_ops)
@@ -874,7 +875,7 @@ static int __init mce_amd_init(void)
874 default: 875 default:
875 printk(KERN_WARNING "Huh? What family is it: 0x%x?!\n", c->x86); 876 printk(KERN_WARNING "Huh? What family is it: 0x%x?!\n", c->x86);
876 kfree(fam_ops); 877 kfree(fam_ops);
877 return -EINVAL; 878 fam_ops = NULL;
878 } 879 }
879 880
880 pr_info("MCE: In-kernel MCE decoding enabled.\n"); 881 pr_info("MCE: In-kernel MCE decoding enabled.\n");