Commit 10d33e9c36827e5371479e55ef4089e000af2638

Authored by Doug Thompson
Committed by Linus Torvalds
1 parent 124682c785

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>

Showing 1 changed file with 42 additions and 17 deletions Side-by-side Diff

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