diff options
author | Borislav Petkov <bp@suse.de> | 2014-02-17 14:51:52 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2014-02-24 04:25:47 -0500 |
commit | fd0f5ffff8a21fd9a32688b850c5bd694e76cc27 (patch) | |
tree | 8e21d9977b96ee04bfa5f0c93da05c7244ddf965 /drivers/edac | |
parent | 9d6c7cbe3073668cc5381978bb800f5e901c178e (diff) |
MCE, AMD: Fix decoding module loading on unsupported hw
We want to still be able to issue some error information on systems for
which there is no decoding support (think older distro kernels here,
for example). Therefore, we allow module registration but skip the
per-family bank-specific decoders and issue the general information
only, i.e.:
[ 46.822828] [Hardware Error]: Error Status: Uncorrected, software containable error.
[ 46.822846] [Hardware Error]: CPU:0 (15:30:0) MC0_STATUS[-|UE|-|-|-|-|-]: 0xa000000000010f0f
[ 46.822858] [Hardware Error]: cache level: L3/GEN, mem/io: GEN, mem-tx: GEN, part-proc: GEN (timed out)
with the hope that it still contains helpful useful bits.
Suggested-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Tested-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Link: http://lkml.kernel.org/r/1392659391-2411-1-git-send-email-Aravind.Gopalakrishnan@amd.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/mce_amd.c | 65 |
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"); |