diff options
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7core_edac.c | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 0c02486cf57a..aeb01f42ffef 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -263,7 +263,7 @@ struct i7core_pvt { | |||
263 | unsigned long rdimm_ce_count[NUM_CHANS][MAX_DIMMS]; | 263 | unsigned long rdimm_ce_count[NUM_CHANS][MAX_DIMMS]; |
264 | int rdimm_last_ce_count[NUM_CHANS][MAX_DIMMS]; | 264 | int rdimm_last_ce_count[NUM_CHANS][MAX_DIMMS]; |
265 | 265 | ||
266 | unsigned int is_registered; | 266 | bool is_registered, enable_scrub; |
267 | 267 | ||
268 | /* mcelog glue */ | 268 | /* mcelog glue */ |
269 | struct edac_mce edac_mce; | 269 | struct edac_mce edac_mce; |
@@ -1487,8 +1487,10 @@ static int mci_bind_devs(struct mem_ctl_info *mci, | |||
1487 | struct i7core_pvt *pvt = mci->pvt_info; | 1487 | struct i7core_pvt *pvt = mci->pvt_info; |
1488 | struct pci_dev *pdev; | 1488 | struct pci_dev *pdev; |
1489 | int i, func, slot; | 1489 | int i, func, slot; |
1490 | char *family; | ||
1490 | 1491 | ||
1491 | pvt->is_registered = 0; | 1492 | pvt->is_registered = false; |
1493 | pvt->enable_scrub = false; | ||
1492 | for (i = 0; i < i7core_dev->n_devs; i++) { | 1494 | for (i = 0; i < i7core_dev->n_devs; i++) { |
1493 | pdev = i7core_dev->pdev[i]; | 1495 | pdev = i7core_dev->pdev[i]; |
1494 | if (!pdev) | 1496 | if (!pdev) |
@@ -1504,9 +1506,37 @@ static int mci_bind_devs(struct mem_ctl_info *mci, | |||
1504 | if (unlikely(func > MAX_CHAN_FUNC)) | 1506 | if (unlikely(func > MAX_CHAN_FUNC)) |
1505 | goto error; | 1507 | goto error; |
1506 | pvt->pci_ch[slot - 4][func] = pdev; | 1508 | pvt->pci_ch[slot - 4][func] = pdev; |
1507 | } else if (!slot && !func) | 1509 | } else if (!slot && !func) { |
1508 | pvt->pci_noncore = pdev; | 1510 | pvt->pci_noncore = pdev; |
1509 | else | 1511 | |
1512 | /* Detect the processor family */ | ||
1513 | switch (pdev->device) { | ||
1514 | case PCI_DEVICE_ID_INTEL_I7_NONCORE: | ||
1515 | family = "Xeon 35xx/ i7core"; | ||
1516 | pvt->enable_scrub = false; | ||
1517 | break; | ||
1518 | case PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT: | ||
1519 | family = "i7-800/i5-700"; | ||
1520 | pvt->enable_scrub = false; | ||
1521 | break; | ||
1522 | case PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE: | ||
1523 | family = "Xeon 34xx"; | ||
1524 | pvt->enable_scrub = false; | ||
1525 | break; | ||
1526 | case PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT: | ||
1527 | family = "Xeon 55xx"; | ||
1528 | pvt->enable_scrub = true; | ||
1529 | break; | ||
1530 | case PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_REV2: | ||
1531 | family = "Xeon 56xx / i7-900"; | ||
1532 | pvt->enable_scrub = true; | ||
1533 | break; | ||
1534 | default: | ||
1535 | family = "unknown"; | ||
1536 | pvt->enable_scrub = false; | ||
1537 | } | ||
1538 | debugf0("Detected a processor type %s\n", family); | ||
1539 | } else | ||
1510 | goto error; | 1540 | goto error; |
1511 | 1541 | ||
1512 | debugf0("Associated fn %d.%d, dev = %p, socket %d\n", | 1542 | debugf0("Associated fn %d.%d, dev = %p, socket %d\n", |
@@ -1515,7 +1545,7 @@ static int mci_bind_devs(struct mem_ctl_info *mci, | |||
1515 | 1545 | ||
1516 | if (PCI_SLOT(pdev->devfn) == 3 && | 1546 | if (PCI_SLOT(pdev->devfn) == 3 && |
1517 | PCI_FUNC(pdev->devfn) == 2) | 1547 | PCI_FUNC(pdev->devfn) == 2) |
1518 | pvt->is_registered = 1; | 1548 | pvt->is_registered = true; |
1519 | } | 1549 | } |
1520 | 1550 | ||
1521 | return 0; | 1551 | return 0; |
@@ -2060,7 +2090,8 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev) | |||
2060 | __func__, mci, &i7core_dev->pdev[0]->dev); | 2090 | __func__, mci, &i7core_dev->pdev[0]->dev); |
2061 | 2091 | ||
2062 | /* Disable scrubrate setting */ | 2092 | /* Disable scrubrate setting */ |
2063 | disable_sdram_scrub_setting(mci); | 2093 | if (pvt->enable_scrub) |
2094 | disable_sdram_scrub_setting(mci); | ||
2064 | 2095 | ||
2065 | /* Disable MCE NMI handler */ | 2096 | /* Disable MCE NMI handler */ |
2066 | edac_mce_unregister(&pvt->edac_mce); | 2097 | edac_mce_unregister(&pvt->edac_mce); |
@@ -2136,7 +2167,8 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev) | |||
2136 | mci->edac_check = i7core_check_error; | 2167 | mci->edac_check = i7core_check_error; |
2137 | 2168 | ||
2138 | /* Enable scrubrate setting */ | 2169 | /* Enable scrubrate setting */ |
2139 | enable_sdram_scrub_setting(mci); | 2170 | if (pvt->enable_scrub) |
2171 | enable_sdram_scrub_setting(mci); | ||
2140 | 2172 | ||
2141 | /* add this new MC control structure to EDAC's list of MCs */ | 2173 | /* add this new MC control structure to EDAC's list of MCs */ |
2142 | if (unlikely(edac_mc_add_mc(mci))) { | 2174 | if (unlikely(edac_mc_add_mc(mci))) { |