aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2008-04-29 04:03:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:26 -0400
commit94ee1cf5a88e12f5cbf8c0c78a6c18d3e043241e (patch)
tree6efa44d83472bacc6052d124133009e63b4b600a /drivers
parent5135b797c8466eac39dc7fb4ae1fac6e7276377a (diff)
edac: add e752x parameter for sysbus_parity selection
Add a module parameter "sysbus_parity" to allow forcing system bus parity error checking on or off. Also add support to automatically disable system bus parity errors for processors which do not support it. If the sysbus_parity parameter is specified, sysbus parity detection will be forced on or off. If it is not specified, the driver will attempt to look at the CPU identifier string and determine if the CPU supports system bus parity. A blacklist was used instead of a whitelist so that system bus parity would be enabled by default and to minimize the chances of breaking things for those people already using the driver which for some reason have a processor that does not have a valid CPU identifier string. [akpm@linux-foundation.org: coding-style fixes] Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Peter Tyser <ptyser@xes-inc.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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/e752x_edac.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 4fbc5892bc2b..12e7677b834b 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -29,6 +29,7 @@
29#define EDAC_MOD_STR "e752x_edac" 29#define EDAC_MOD_STR "e752x_edac"
30 30
31static int force_function_unhide; 31static int force_function_unhide;
32static int sysbus_parity = -1;
32 33
33static struct edac_pci_ctl_info *e752x_pci; 34static struct edac_pci_ctl_info *e752x_pci;
34 35
@@ -1049,6 +1050,37 @@ fail:
1049 return 1; 1050 return 1;
1050} 1051}
1051 1052
1053/* Setup system bus parity mask register.
1054 * Sysbus parity supported on:
1055 * e7320/e7520/e7525 + Xeon
1056 * i3100 + Xeon/Celeron
1057 * Sysbus parity not supported on:
1058 * i3100 + Pentium M/Celeron M/Core Duo/Core2 Duo
1059 */
1060static void e752x_init_sysbus_parity_mask(struct e752x_pvt *pvt)
1061{
1062 char *cpu_id = cpu_data(0).x86_model_id;
1063 struct pci_dev *dev = pvt->dev_d0f1;
1064 int enable = 1;
1065
1066 /* Allow module paramter override, else see if CPU supports parity */
1067 if (sysbus_parity != -1) {
1068 enable = sysbus_parity;
1069 } else if (cpu_id[0] &&
1070 ((strstr(cpu_id, "Pentium") && strstr(cpu_id, " M ")) ||
1071 (strstr(cpu_id, "Celeron") && strstr(cpu_id, " M ")) ||
1072 (strstr(cpu_id, "Core") && strstr(cpu_id, "Duo")))) {
1073 e752x_printk(KERN_INFO, "System Bus Parity not "
1074 "supported by CPU, disabling\n");
1075 enable = 0;
1076 }
1077
1078 if (enable)
1079 pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x0000);
1080 else
1081 pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x0309);
1082}
1083
1052static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt) 1084static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt)
1053{ 1085{
1054 struct pci_dev *dev; 1086 struct pci_dev *dev;
@@ -1062,7 +1094,9 @@ static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt)
1062 pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00); 1094 pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00);
1063 pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00); 1095 pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00);
1064 } 1096 }
1065 pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00); 1097
1098 e752x_init_sysbus_parity_mask(pvt);
1099
1066 pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00); 1100 pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00);
1067 pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00); 1101 pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00);
1068 pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00); 1102 pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00);
@@ -1291,3 +1325,7 @@ MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:"
1291 " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access"); 1325 " 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access");
1292module_param(edac_op_state, int, 0444); 1326module_param(edac_op_state, int, 0444);
1293MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); 1327MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI");
1328
1329module_param(sysbus_parity, int, 0444);
1330MODULE_PARM_DESC(sysbus_parity, "0=disable system bus parity checking,"
1331 " 1=enable system bus parity checking, default=auto-detect");