edac: i5100 fix enable ecc hardware

It is possible that the BIOS did not enable ECC at boot time. We check
for that case and fail to load if it is true.

Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arthur Jones and committed by
Linus Torvalds
43920a59 f7952ffc

+10
+10
drivers/edac/i5100_edac.c
··· 24 24 /* register addresses and bit field accessors... */ 25 25 26 26 /* device 16, func 1 */ 27 + #define I5100_MC 0x40 /* Memory Control Register */ 28 + #define I5100_MC_ERRDETEN(a) ((a) >> 5 & 1) 27 29 #define I5100_MS 0x44 /* Memory Status Register */ 28 30 #define I5100_SPDDATA 0x48 /* Serial Presence Detect Status Reg */ 29 31 #define I5100_SPDDATA_RDO(a) ((a) >> 15 & 1) ··· 687 685 rc = pci_enable_device(pdev); 688 686 if (rc < 0) { 689 687 ret = rc; 688 + goto bail; 689 + } 690 + 691 + /* ECC enabled? */ 692 + pci_read_config_dword(pdev, I5100_MC, &dw); 693 + if (!I5100_MC_ERRDETEN(dw)) { 694 + printk(KERN_INFO "i5100_edac: ECC not enabled.\n"); 695 + ret = -ENODEV; 690 696 goto bail; 691 697 } 692 698