diff options
Diffstat (limited to 'drivers/edac/x38_edac.c')
-rw-r--r-- | drivers/edac/x38_edac.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c index 1ac7962d63ea..08a992693e62 100644 --- a/drivers/edac/x38_edac.c +++ b/drivers/edac/x38_edac.c | |||
@@ -103,10 +103,10 @@ static int how_many_channel(struct pci_dev *pdev) | |||
103 | 103 | ||
104 | pci_read_config_byte(pdev, X38_CAPID0 + 8, &capid0_8b); | 104 | pci_read_config_byte(pdev, X38_CAPID0 + 8, &capid0_8b); |
105 | if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */ | 105 | if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */ |
106 | debugf0("In single channel mode.\n"); | 106 | edac_dbg(0, "In single channel mode\n"); |
107 | x38_channel_num = 1; | 107 | x38_channel_num = 1; |
108 | } else { | 108 | } else { |
109 | debugf0("In dual channel mode.\n"); | 109 | edac_dbg(0, "In dual channel mode\n"); |
110 | x38_channel_num = 2; | 110 | x38_channel_num = 2; |
111 | } | 111 | } |
112 | 112 | ||
@@ -151,7 +151,7 @@ static void x38_clear_error_info(struct mem_ctl_info *mci) | |||
151 | { | 151 | { |
152 | struct pci_dev *pdev; | 152 | struct pci_dev *pdev; |
153 | 153 | ||
154 | pdev = to_pci_dev(mci->dev); | 154 | pdev = to_pci_dev(mci->pdev); |
155 | 155 | ||
156 | /* | 156 | /* |
157 | * Clear any error bits. | 157 | * Clear any error bits. |
@@ -172,7 +172,7 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, | |||
172 | struct pci_dev *pdev; | 172 | struct pci_dev *pdev; |
173 | void __iomem *window = mci->pvt_info; | 173 | void __iomem *window = mci->pvt_info; |
174 | 174 | ||
175 | pdev = to_pci_dev(mci->dev); | 175 | pdev = to_pci_dev(mci->pdev); |
176 | 176 | ||
177 | /* | 177 | /* |
178 | * This is a mess because there is no atomic way to read all the | 178 | * This is a mess because there is no atomic way to read all the |
@@ -215,26 +215,26 @@ static void x38_process_error_info(struct mem_ctl_info *mci, | |||
215 | return; | 215 | return; |
216 | 216 | ||
217 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { | 217 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { |
218 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0, | 218 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, 0, 0, 0, |
219 | -1, -1, -1, | 219 | -1, -1, -1, |
220 | "UE overwrote CE", "", NULL); | 220 | "UE overwrote CE", ""); |
221 | info->errsts = info->errsts2; | 221 | info->errsts = info->errsts2; |
222 | } | 222 | } |
223 | 223 | ||
224 | for (channel = 0; channel < x38_channel_num; channel++) { | 224 | for (channel = 0; channel < x38_channel_num; channel++) { |
225 | log = info->eccerrlog[channel]; | 225 | log = info->eccerrlog[channel]; |
226 | if (log & X38_ECCERRLOG_UE) { | 226 | if (log & X38_ECCERRLOG_UE) { |
227 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, | 227 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, |
228 | 0, 0, 0, | 228 | 0, 0, 0, |
229 | eccerrlog_row(channel, log), | 229 | eccerrlog_row(channel, log), |
230 | -1, -1, | 230 | -1, -1, |
231 | "x38 UE", "", NULL); | 231 | "x38 UE", ""); |
232 | } else if (log & X38_ECCERRLOG_CE) { | 232 | } else if (log & X38_ECCERRLOG_CE) { |
233 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, | 233 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, |
234 | 0, 0, eccerrlog_syndrome(log), | 234 | 0, 0, eccerrlog_syndrome(log), |
235 | eccerrlog_row(channel, log), | 235 | eccerrlog_row(channel, log), |
236 | -1, -1, | 236 | -1, -1, |
237 | "x38 CE", "", NULL); | 237 | "x38 CE", ""); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | } | 240 | } |
@@ -243,7 +243,7 @@ static void x38_check(struct mem_ctl_info *mci) | |||
243 | { | 243 | { |
244 | struct x38_error_info info; | 244 | struct x38_error_info info; |
245 | 245 | ||
246 | debugf1("MC%d: %s()\n", mci->mc_idx, __func__); | 246 | edac_dbg(1, "MC%d\n", mci->mc_idx); |
247 | x38_get_and_clear_error_info(mci, &info); | 247 | x38_get_and_clear_error_info(mci, &info); |
248 | x38_process_error_info(mci, &info); | 248 | x38_process_error_info(mci, &info); |
249 | } | 249 | } |
@@ -331,7 +331,7 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
331 | bool stacked; | 331 | bool stacked; |
332 | void __iomem *window; | 332 | void __iomem *window; |
333 | 333 | ||
334 | debugf0("MC: %s()\n", __func__); | 334 | edac_dbg(0, "MC:\n"); |
335 | 335 | ||
336 | window = x38_map_mchbar(pdev); | 336 | window = x38_map_mchbar(pdev); |
337 | if (!window) | 337 | if (!window) |
@@ -352,9 +352,9 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
352 | if (!mci) | 352 | if (!mci) |
353 | return -ENOMEM; | 353 | return -ENOMEM; |
354 | 354 | ||
355 | debugf3("MC: %s(): init mci\n", __func__); | 355 | edac_dbg(3, "MC: init mci\n"); |
356 | 356 | ||
357 | mci->dev = &pdev->dev; | 357 | mci->pdev = &pdev->dev; |
358 | mci->mtype_cap = MEM_FLAG_DDR2; | 358 | mci->mtype_cap = MEM_FLAG_DDR2; |
359 | 359 | ||
360 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; | 360 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; |
@@ -378,7 +378,7 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
378 | */ | 378 | */ |
379 | for (i = 0; i < mci->nr_csrows; i++) { | 379 | for (i = 0; i < mci->nr_csrows; i++) { |
380 | unsigned long nr_pages; | 380 | unsigned long nr_pages; |
381 | struct csrow_info *csrow = &mci->csrows[i]; | 381 | struct csrow_info *csrow = mci->csrows[i]; |
382 | 382 | ||
383 | nr_pages = drb_to_nr_pages(drbs, stacked, | 383 | nr_pages = drb_to_nr_pages(drbs, stacked, |
384 | i / X38_RANKS_PER_CHANNEL, | 384 | i / X38_RANKS_PER_CHANNEL, |
@@ -388,7 +388,7 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
388 | continue; | 388 | continue; |
389 | 389 | ||
390 | for (j = 0; j < x38_channel_num; j++) { | 390 | for (j = 0; j < x38_channel_num; j++) { |
391 | struct dimm_info *dimm = csrow->channels[j].dimm; | 391 | struct dimm_info *dimm = csrow->channels[j]->dimm; |
392 | 392 | ||
393 | dimm->nr_pages = nr_pages / x38_channel_num; | 393 | dimm->nr_pages = nr_pages / x38_channel_num; |
394 | dimm->grain = nr_pages << PAGE_SHIFT; | 394 | dimm->grain = nr_pages << PAGE_SHIFT; |
@@ -402,12 +402,12 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
402 | 402 | ||
403 | rc = -ENODEV; | 403 | rc = -ENODEV; |
404 | if (edac_mc_add_mc(mci)) { | 404 | if (edac_mc_add_mc(mci)) { |
405 | debugf3("MC: %s(): failed edac_mc_add_mc()\n", __func__); | 405 | edac_dbg(3, "MC: failed edac_mc_add_mc()\n"); |
406 | goto fail; | 406 | goto fail; |
407 | } | 407 | } |
408 | 408 | ||
409 | /* get this far and it's successful */ | 409 | /* get this far and it's successful */ |
410 | debugf3("MC: %s(): success\n", __func__); | 410 | edac_dbg(3, "MC: success\n"); |
411 | return 0; | 411 | return 0; |
412 | 412 | ||
413 | fail: | 413 | fail: |
@@ -423,7 +423,7 @@ static int __devinit x38_init_one(struct pci_dev *pdev, | |||
423 | { | 423 | { |
424 | int rc; | 424 | int rc; |
425 | 425 | ||
426 | debugf0("MC: %s()\n", __func__); | 426 | edac_dbg(0, "MC:\n"); |
427 | 427 | ||
428 | if (pci_enable_device(pdev) < 0) | 428 | if (pci_enable_device(pdev) < 0) |
429 | return -EIO; | 429 | return -EIO; |
@@ -439,7 +439,7 @@ static void __devexit x38_remove_one(struct pci_dev *pdev) | |||
439 | { | 439 | { |
440 | struct mem_ctl_info *mci; | 440 | struct mem_ctl_info *mci; |
441 | 441 | ||
442 | debugf0("%s()\n", __func__); | 442 | edac_dbg(0, "\n"); |
443 | 443 | ||
444 | mci = edac_mc_del_mc(&pdev->dev); | 444 | mci = edac_mc_del_mc(&pdev->dev); |
445 | if (!mci) | 445 | if (!mci) |
@@ -472,7 +472,7 @@ static int __init x38_init(void) | |||
472 | { | 472 | { |
473 | int pci_rc; | 473 | int pci_rc; |
474 | 474 | ||
475 | debugf3("MC: %s()\n", __func__); | 475 | edac_dbg(3, "MC:\n"); |
476 | 476 | ||
477 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ | 477 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ |
478 | opstate_init(); | 478 | opstate_init(); |
@@ -486,14 +486,14 @@ static int __init x38_init(void) | |||
486 | mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 486 | mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
487 | PCI_DEVICE_ID_INTEL_X38_HB, NULL); | 487 | PCI_DEVICE_ID_INTEL_X38_HB, NULL); |
488 | if (!mci_pdev) { | 488 | if (!mci_pdev) { |
489 | debugf0("x38 pci_get_device fail\n"); | 489 | edac_dbg(0, "x38 pci_get_device fail\n"); |
490 | pci_rc = -ENODEV; | 490 | pci_rc = -ENODEV; |
491 | goto fail1; | 491 | goto fail1; |
492 | } | 492 | } |
493 | 493 | ||
494 | pci_rc = x38_init_one(mci_pdev, x38_pci_tbl); | 494 | pci_rc = x38_init_one(mci_pdev, x38_pci_tbl); |
495 | if (pci_rc < 0) { | 495 | if (pci_rc < 0) { |
496 | debugf0("x38 init fail\n"); | 496 | edac_dbg(0, "x38 init fail\n"); |
497 | pci_rc = -ENODEV; | 497 | pci_rc = -ENODEV; |
498 | goto fail1; | 498 | goto fail1; |
499 | } | 499 | } |
@@ -513,7 +513,7 @@ fail0: | |||
513 | 513 | ||
514 | static void __exit x38_exit(void) | 514 | static void __exit x38_exit(void) |
515 | { | 515 | { |
516 | debugf3("MC: %s()\n", __func__); | 516 | edac_dbg(3, "MC:\n"); |
517 | 517 | ||
518 | pci_unregister_driver(&x38_driver); | 518 | pci_unregister_driver(&x38_driver); |
519 | if (!x38_registered) { | 519 | if (!x38_registered) { |