edac: e752x fix too loud on nonmemory errors

This module harvests more than just memory errors, it also harvests
various bus and dma errors that the Chipset detects. Previously, it would
report all such errors, which would cause output to be TOO loud.

This patches therefore adds a parameter which is used to turn off
NON-MEMORY error reports by default. Or the reporting can be enabled via
the parameter

Also did code style cleanup: less than 80 characters per line rule

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

Doug Thompson and committed by
Linus Torvalds
10d33e9c 124682c7

+42 -17
+42 -17
drivers/edac/e752x_edac.c
··· 28 28 #define E752X_REVISION " Ver: 2.0.2 " __DATE__ 29 29 #define EDAC_MOD_STR "e752x_edac" 30 30 31 + static int report_non_memory_errors; 31 32 static int force_function_unhide; 32 33 static int sysbus_parity = -1; 33 34 ··· 118 117 #define E752X_BUF_FERR 0x70 /* Memory buffer first error reg (8b) */ 119 118 #define E752X_BUF_NERR 0x72 /* Memory buffer next error reg (8b) */ 120 119 #define E752X_BUF_ERRMASK 0x74 /* Memory buffer error mask reg (8b) */ 121 - #define E752X_BUF_SMICMD 0x7A /* Memory buffer SMI command reg (8b) */ 120 + #define E752X_BUF_SMICMD 0x7A /* Memory buffer SMI cmd reg (8b) */ 122 121 #define E752X_DRAM_FERR 0x80 /* DRAM first error register (16b) */ 123 122 #define E752X_DRAM_NERR 0x82 /* DRAM next error register (16b) */ 124 123 #define E752X_DRAM_ERRMASK 0x84 /* DRAM error mask register (8b) */ ··· 128 127 /* error address register (32b) */ 129 128 /* 130 129 * 31 Reserved 131 - * 30:2 CE address (64 byte block 34:6) 130 + * 30:2 CE address (64 byte block 34:6 132 131 * 1 Reserved 133 132 * 0 HiLoCS 134 133 */ ··· 148 147 * 1 Reserved 149 148 * 0 HiLoCS 150 149 */ 151 - #define E752X_DRAM_SCRB_ADD 0xA8 /* DRAM first uncorrectable scrub memory */ 150 + #define E752X_DRAM_SCRB_ADD 0xA8 /* DRAM 1st uncorrectable scrub mem */ 152 151 /* error address register (32b) */ 153 152 /* 154 153 * 31 Reserved 155 - * 30:2 CE address (64 byte block 34:6) 154 + * 30:2 CE address (64 byte block 34:6 156 155 * 1 Reserved 157 156 * 0 HiLoCS 158 157 */ ··· 395 394 struct e752x_pvt *pvt = (struct e752x_pvt *)mci->pvt_info; 396 395 397 396 error_1b = retry_add; 398 - page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ 399 - row = pvt->mc_symmetric ? ((page >> 1) & 3) : /* chip select are bits 14 & 13 */ 397 + page = error_1b >> (PAGE_SHIFT - 4); /* convert the addr to 4k page */ 398 + 399 + /* chip select are bits 14 & 13 */ 400 + row = pvt->mc_symmetric ? ((page >> 1) & 3) : 400 401 edac_mc_find_csrow_by_page(mci, page); 402 + 401 403 e752x_mc_printk(mci, KERN_WARNING, 402 404 "CE page 0x%lx, row %d : Memory read retry\n", 403 405 (long unsigned int)page, row); ··· 426 422 } 427 423 428 424 static char *global_message[11] = { 429 - "PCI Express C1", "PCI Express C", "PCI Express B1", 430 - "PCI Express B", "PCI Express A1", "PCI Express A", 431 - "DMA Controler", "HUB or NS Interface", "System Bus", 432 - "DRAM Controler", "Internal Buffer" 425 + "PCI Express C1", 426 + "PCI Express C", 427 + "PCI Express B1", 428 + "PCI Express B", 429 + "PCI Express A1", 430 + "PCI Express A", 431 + "DMA Controller", 432 + "HUB or NS Interface", 433 + "System Bus", 434 + "DRAM Controller", /* 9th entry */ 435 + "Internal Buffer" 433 436 }; 437 + 438 + #define DRAM_ENTRY 9 434 439 435 440 static char *fatal_message[2] = { "Non-Fatal ", "Fatal " }; 436 441 ··· 448 435 int i; 449 436 450 437 for (i = 0; i < 11; i++) { 451 - if (errors & (1 << i)) 452 - e752x_printk(KERN_WARNING, "%sError %s\n", 453 - fatal_message[fatal], global_message[i]); 438 + if (errors & (1 << i)) { 439 + /* If the error is from DRAM Controller OR 440 + * we are to report ALL errors, then 441 + * report the error 442 + */ 443 + if ((i == DRAM_ENTRY) || report_non_memory_errors) 444 + e752x_printk(KERN_WARNING, "%sError %s\n", 445 + fatal_message[fatal], 446 + global_message[i]); 447 + } 454 448 } 455 449 } 456 450 ··· 1041 1021 struct pci_dev *dev; 1042 1022 1043 1023 pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, 1044 - pvt->dev_info->err_dev, pvt->bridge_ck); 1024 + pvt->dev_info->err_dev, pvt->bridge_ck); 1045 1025 1046 1026 if (pvt->bridge_ck == NULL) 1047 1027 pvt->bridge_ck = pci_scan_single_device(pdev->bus, ··· 1054 1034 return 1; 1055 1035 } 1056 1036 1057 - dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, 1058 - NULL); 1037 + dev = pci_get_device(PCI_VENDOR_ID_INTEL, 1038 + e752x_devs[dev_idx].ctl_dev, 1039 + NULL); 1059 1040 1060 1041 if (dev == NULL) 1061 1042 goto fail; ··· 1337 1316 1338 1317 module_param(force_function_unhide, int, 0444); 1339 1318 MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:" 1340 - " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access"); 1319 + " 1=force unhide and hope BIOS doesn't fight driver for " 1320 + "Dev0:Fun1 access"); 1341 1321 1342 1322 module_param(edac_op_state, int, 0444); 1343 1323 MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); ··· 1346 1324 module_param(sysbus_parity, int, 0444); 1347 1325 MODULE_PARM_DESC(sysbus_parity, "0=disable system bus parity checking," 1348 1326 " 1=enable system bus parity checking, default=auto-detect"); 1327 + module_param(report_non_memory_errors, int, 0644); 1328 + MODULE_PARM_DESC(report_non_memory_errors, "0=disable non-memory error " 1329 + "reporting, 1=enable non-memory error reporting");