android_kernel_xiaomi_sm8350/drivers/edac
Ingo Molnar f436f8bb73 x86: EDAC: MCE: Fix MCE decoding callback logic
Make decoding of MCEs happen only on AMD hardware by registering a
non-default callback only on CPU families which support it.

While looking at the interaction of decode_mce() with the other MCE
code i also noticed a few other things and made the following
cleanups/fixes:

 - Fixed the mce_decode() weak alias - a weak alias is really not
   good here, it should be a proper callback. A weak alias will be
   overriden if a piece of code is built into the kernel - not
   good, obviously.

 - The patch initializes the callback on AMD family 10h and 11h.

 - Added the more correct fallback printk of:

	No support for human readable MCE decoding on this CPU type.
	Transcribe the message and run it through 'mcelog --ascii' to decode.

   On CPUs that dont have a decoder.

 - Made the surrounding code more readable.

Note that the callback allows us to have a default fallback -
without having to check the CPU versions during the printout
itself. When an EDAC module registers itself, it can install the
decode-print function.

(there's no unregister needed as this is core code.)

version -v2 by Borislav Petkov:

 - add K8 to the set of supported CPUs

 - always build in edac_mce_amd since we use an early_initcall now

 - fix checkpatch warnings

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <20091001141432.GA11410@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-10-02 15:42:18 +02:00
..
amd64_edac_dbg.c x86, mce: pass mce info to EDAC for decoding 2009-09-14 18:59:17 +02:00
amd64_edac_inj.c amd64_edac: add DRAM error injection logic using sysfs 2009-06-10 12:18:47 +02:00
amd64_edac.c amd64_edac: check NB MCE bank enable on the current node properly 2009-09-16 13:05:46 +02:00
amd64_edac.h x86, mce: pass mce info to EDAC for decoding 2009-09-14 18:59:17 +02:00
amd76x_edac.c
amd8111_edac.c edac: add edac_device_alloc_index() 2009-06-18 13:03:56 -07:00
amd8111_edac.h edac: AMD8111 driver header file 2009-04-02 19:05:03 -07:00
amd8131_edac.c edac: AMD8111 & AMD8131 use dev_name() 2009-05-29 08:40:03 -07:00
amd8131_edac.h edac: AMD8131 driver header file 2009-04-02 19:05:03 -07:00
cell_edac.c edac: add missing __devexit_p() 2009-06-18 13:03:57 -07:00
cpc925_edac.c edac: fix resource size calculation 2009-09-24 07:21:04 -07:00
e7xxx_edac.c
e752x_edac.c trivial: fix typos s/paramter/parameter/ and s/excute/execute/ in documentation and source comments. 2009-06-12 18:01:46 +02:00
edac_core.h trivial: fix typo "for for" in multiple files 2009-09-21 15:14:54 +02:00
edac_device_sysfs.c
edac_device.c edac: core: remove completion-wait for complete with rcu_barrier 2009-09-24 07:21:05 -07:00
edac_mc_sysfs.c edac: add DDR3 memory type for MPC85xx EDAC 2009-06-30 18:55:59 -07:00
edac_mc.c edac: core: remove completion-wait for complete with rcu_barrier 2009-09-24 07:21:05 -07:00
edac_mce_amd.c x86: EDAC: MCE: Fix MCE decoding callback logic 2009-10-02 15:42:18 +02:00
edac_mce_amd.h EDAC, AMD: carve out MCi_STATUS decoding 2009-09-14 19:01:07 +02:00
edac_module.c
edac_module.h
edac_pci_sysfs.c
edac_pci.c edac: core: remove completion-wait for complete with rcu_barrier 2009-09-24 07:21:05 -07:00
edac_stub.c
i3000_edac.c
i3200_edac.c edac: i3200 memory controller driver 2009-09-24 07:21:04 -07:00
i5000_edac.c
i5100_edac.c
i5400_edac.c
i82443bxgx_edac.c
i82860_edac.c
i82875p_edac.c
i82975x_edac.c
Kconfig edac: i3200 memory controller driver 2009-09-24 07:21:04 -07:00
Makefile x86: EDAC: MCE: Fix MCE decoding callback logic 2009-10-02 15:42:18 +02:00
mpc85xx_edac.c edac: mpc85xx add mpc83xx support 2009-09-24 07:21:04 -07:00
mpc85xx_edac.h edac: add DDR3 memory type for MPC85xx EDAC 2009-06-30 18:55:59 -07:00
mv64x60_edac.c edac: fix resource size calculation 2009-09-24 07:21:04 -07:00
mv64x60_edac.h
pasemi_edac.c
ppc4xx_edac.c edac: new ppc4xx driver module 2009-04-02 19:05:03 -07:00
ppc4xx_edac.h edac: new ppc4xx driver module 2009-04-02 19:05:03 -07:00
r82600_edac.c
x38_edac.c edac: x38 fix mchbar high register addr 2009-07-29 19:10:34 -07:00