aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/e752x_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/e752x_edac.c')
-rw-r--r--drivers/edac/e752x_edac.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 48373fdc6343..f31725a55e54 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -181,6 +181,7 @@ struct e752x_pvt {
181 181
182struct e752x_dev_info { 182struct e752x_dev_info {
183 u16 err_dev; 183 u16 err_dev;
184 u16 ctl_dev;
184 const char *ctl_name; 185 const char *ctl_name;
185}; 186};
186 187
@@ -207,12 +208,15 @@ struct e752x_error_info {
207static const struct e752x_dev_info e752x_devs[] = { 208static const struct e752x_dev_info e752x_devs[] = {
208 [E7520] = { 209 [E7520] = {
209 .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR, 210 .err_dev = PCI_DEVICE_ID_INTEL_7520_1_ERR,
211 .ctl_dev = PCI_DEVICE_ID_INTEL_7520_0,
210 .ctl_name = "E7520"}, 212 .ctl_name = "E7520"},
211 [E7525] = { 213 [E7525] = {
212 .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR, 214 .err_dev = PCI_DEVICE_ID_INTEL_7525_1_ERR,
215 .ctl_dev = PCI_DEVICE_ID_INTEL_7525_0,
213 .ctl_name = "E7525"}, 216 .ctl_name = "E7525"},
214 [E7320] = { 217 [E7320] = {
215 .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR, 218 .err_dev = PCI_DEVICE_ID_INTEL_7320_1_ERR,
219 .ctl_dev = PCI_DEVICE_ID_INTEL_7320_0,
216 .ctl_name = "E7320"}, 220 .ctl_name = "E7320"},
217}; 221};
218 222
@@ -742,7 +746,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
742{ 746{
743 int rc = -ENODEV; 747 int rc = -ENODEV;
744 int index; 748 int index;
745 u16 pci_data, stat; 749 u16 pci_data;
746 u32 stat32; 750 u32 stat32;
747 u16 stat16; 751 u16 stat16;
748 u8 stat8; 752 u8 stat8;
@@ -755,7 +759,6 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
755 int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ 759 int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */
756 u32 dra; 760 u32 dra;
757 unsigned long last_cumul_size; 761 unsigned long last_cumul_size;
758 struct pci_dev *pres_dev;
759 struct pci_dev *dev = NULL; 762 struct pci_dev *dev = NULL;
760 763
761 debugf0("%s(): mci\n", __func__); 764 debugf0("%s(): mci\n", __func__);
@@ -920,33 +923,9 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
920 goto fail; 923 goto fail;
921 } 924 }
922 925
923 /* Walk through the PCI table and clear errors */ 926 dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev,
924 switch (dev_idx) { 927 NULL);
925 case E7520:
926 dev = pci_get_device(PCI_VENDOR_ID_INTEL,
927 PCI_DEVICE_ID_INTEL_7520_0, NULL);
928 break;
929 case E7525:
930 dev = pci_get_device(PCI_VENDOR_ID_INTEL,
931 PCI_DEVICE_ID_INTEL_7525_0, NULL);
932 break;
933 case E7320:
934 dev = pci_get_device(PCI_VENDOR_ID_INTEL,
935 PCI_DEVICE_ID_INTEL_7320_0, NULL);
936 break;
937 }
938
939
940 pvt->dev_d0f0 = dev; 928 pvt->dev_d0f0 = dev;
941 for (pres_dev = dev;
942 ((struct pci_dev *) pres_dev->global_list.next != dev);
943 pres_dev = (struct pci_dev *) pres_dev->global_list.next) {
944 pci_read_config_dword(pres_dev, PCI_COMMAND, &stat32);
945 stat = (u16) (stat32 >> 16);
946 /* clear any error bits */
947 if (stat32 & ((1 << 6) + (1 << 8)))
948 pci_write_config_word(pres_dev, PCI_STATUS, stat);
949 }
950 /* find the error reporting device and clear errors */ 929 /* find the error reporting device and clear errors */
951 dev = pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); 930 dev = pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck);
952 /* Turn off error disable & SMI in case the BIOS turned it on */ 931 /* Turn off error disable & SMI in case the BIOS turned it on */