diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-17 16:02:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-10-31 13:10:04 -0400 |
commit | 224e871f36e1f9edddb0dfecbb84ff9765af3eb4 (patch) | |
tree | fe0442d61ecc371e72562e4d1f940a877edf2c33 | |
parent | 80b8ce89ebb145d91fd2ef1a1e9610aee1613109 (diff) |
i7core_edac: Fix oops when trying to inject errors
Error injection needs the pci device 0:0. So, we need to revert
this changeset: 79daef2099a02fed35747c23bad22f30441133ea.
Tests need to be made to be sure that refcount won't be wrong
as noticed before.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/edac/i7core_edac.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 35a0ff527357..c64ba267902f 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -281,8 +281,7 @@ static const struct pci_id_descr pci_dev_descr_i7core_nehalem[] = { | |||
281 | /* Memory controller */ | 281 | /* Memory controller */ |
282 | { PCI_DESCR(3, 0, PCI_DEVICE_ID_INTEL_I7_MCR) }, | 282 | { PCI_DESCR(3, 0, PCI_DEVICE_ID_INTEL_I7_MCR) }, |
283 | { PCI_DESCR(3, 1, PCI_DEVICE_ID_INTEL_I7_MC_TAD) }, | 283 | { PCI_DESCR(3, 1, PCI_DEVICE_ID_INTEL_I7_MC_TAD) }, |
284 | 284 | /* Exists only for RDIMM */ | |
285 | /* Exists only for RDIMM */ | ||
286 | { PCI_DESCR(3, 2, PCI_DEVICE_ID_INTEL_I7_MC_RAS), .optional = 1 }, | 285 | { PCI_DESCR(3, 2, PCI_DEVICE_ID_INTEL_I7_MC_RAS), .optional = 1 }, |
287 | { PCI_DESCR(3, 4, PCI_DEVICE_ID_INTEL_I7_MC_TEST) }, | 286 | { PCI_DESCR(3, 4, PCI_DEVICE_ID_INTEL_I7_MC_TEST) }, |
288 | 287 | ||
@@ -303,6 +302,16 @@ static const struct pci_id_descr pci_dev_descr_i7core_nehalem[] = { | |||
303 | { PCI_DESCR(6, 1, PCI_DEVICE_ID_INTEL_I7_MC_CH2_ADDR) }, | 302 | { PCI_DESCR(6, 1, PCI_DEVICE_ID_INTEL_I7_MC_CH2_ADDR) }, |
304 | { PCI_DESCR(6, 2, PCI_DEVICE_ID_INTEL_I7_MC_CH2_RANK) }, | 303 | { PCI_DESCR(6, 2, PCI_DEVICE_ID_INTEL_I7_MC_CH2_RANK) }, |
305 | { PCI_DESCR(6, 3, PCI_DEVICE_ID_INTEL_I7_MC_CH2_TC) }, | 304 | { PCI_DESCR(6, 3, PCI_DEVICE_ID_INTEL_I7_MC_CH2_TC) }, |
305 | |||
306 | /* Generic Non-core registers */ | ||
307 | /* | ||
308 | * This is the PCI device on i7core and on Xeon 35xx (8086:2c41) | ||
309 | * On Xeon 55xx, however, it has a different id (8086:2c40). So, | ||
310 | * the probing code needs to test for the other address in case of | ||
311 | * failure of this one | ||
312 | */ | ||
313 | { PCI_DESCR(0, 0, PCI_DEVICE_ID_INTEL_I7_NONCORE) }, | ||
314 | |||
306 | }; | 315 | }; |
307 | 316 | ||
308 | static const struct pci_id_descr pci_dev_descr_lynnfield[] = { | 317 | static const struct pci_id_descr pci_dev_descr_lynnfield[] = { |
@@ -319,6 +328,12 @@ static const struct pci_id_descr pci_dev_descr_lynnfield[] = { | |||
319 | { PCI_DESCR( 5, 1, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_ADDR) }, | 328 | { PCI_DESCR( 5, 1, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_ADDR) }, |
320 | { PCI_DESCR( 5, 2, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_RANK) }, | 329 | { PCI_DESCR( 5, 2, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_RANK) }, |
321 | { PCI_DESCR( 5, 3, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_TC) }, | 330 | { PCI_DESCR( 5, 3, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_TC) }, |
331 | |||
332 | /* | ||
333 | * This is the PCI device has an alternate address on some | ||
334 | * processors like Core i7 860 | ||
335 | */ | ||
336 | { PCI_DESCR( 0, 0, PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE) }, | ||
322 | }; | 337 | }; |
323 | 338 | ||
324 | static const struct pci_id_descr pci_dev_descr_i7core_westmere[] = { | 339 | static const struct pci_id_descr pci_dev_descr_i7core_westmere[] = { |
@@ -346,6 +361,10 @@ static const struct pci_id_descr pci_dev_descr_i7core_westmere[] = { | |||
346 | { PCI_DESCR(6, 1, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_ADDR_REV2) }, | 361 | { PCI_DESCR(6, 1, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_ADDR_REV2) }, |
347 | { PCI_DESCR(6, 2, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_RANK_REV2) }, | 362 | { PCI_DESCR(6, 2, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_RANK_REV2) }, |
348 | { PCI_DESCR(6, 3, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_TC_REV2) }, | 363 | { PCI_DESCR(6, 3, PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_TC_REV2) }, |
364 | |||
365 | /* Generic Non-core registers */ | ||
366 | { PCI_DESCR(0, 0, PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_REV2) }, | ||
367 | |||
349 | }; | 368 | }; |
350 | 369 | ||
351 | #define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) } | 370 | #define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) } |
@@ -1324,6 +1343,20 @@ static int i7core_get_onedevice(struct pci_dev **prev, | |||
1324 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 1343 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
1325 | dev_descr->dev_id, *prev); | 1344 | dev_descr->dev_id, *prev); |
1326 | 1345 | ||
1346 | /* | ||
1347 | * On Xeon 55xx, the Intel Quckpath Arch Generic Non-core regs | ||
1348 | * is at addr 8086:2c40, instead of 8086:2c41. So, we need | ||
1349 | * to probe for the alternate address in case of failure | ||
1350 | */ | ||
1351 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_I7_NONCORE && !pdev) | ||
1352 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | ||
1353 | PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT, *prev); | ||
1354 | |||
1355 | if (dev_descr->dev_id == PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE && !pdev) | ||
1356 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | ||
1357 | PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT, | ||
1358 | *prev); | ||
1359 | |||
1327 | if (!pdev) { | 1360 | if (!pdev) { |
1328 | if (*prev) { | 1361 | if (*prev) { |
1329 | *prev = pdev; | 1362 | *prev = pdev; |