diff options
Diffstat (limited to 'drivers/edac/i3200_edac.c')
-rw-r--r-- | drivers/edac/i3200_edac.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c index bbe43ef71823..47180a08edad 100644 --- a/drivers/edac/i3200_edac.c +++ b/drivers/edac/i3200_edac.c | |||
@@ -110,10 +110,10 @@ static int how_many_channels(struct pci_dev *pdev) | |||
110 | 110 | ||
111 | pci_read_config_byte(pdev, I3200_CAPID0 + 8, &capid0_8b); | 111 | pci_read_config_byte(pdev, I3200_CAPID0 + 8, &capid0_8b); |
112 | if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */ | 112 | if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */ |
113 | debugf0("In single channel mode.\n"); | 113 | edac_dbg(0, "In single channel mode\n"); |
114 | return 1; | 114 | return 1; |
115 | } else { | 115 | } else { |
116 | debugf0("In dual channel mode.\n"); | 116 | edac_dbg(0, "In dual channel mode\n"); |
117 | return 2; | 117 | return 2; |
118 | } | 118 | } |
119 | } | 119 | } |
@@ -159,7 +159,7 @@ static void i3200_clear_error_info(struct mem_ctl_info *mci) | |||
159 | { | 159 | { |
160 | struct pci_dev *pdev; | 160 | struct pci_dev *pdev; |
161 | 161 | ||
162 | pdev = to_pci_dev(mci->dev); | 162 | pdev = to_pci_dev(mci->pdev); |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * Clear any error bits. | 165 | * Clear any error bits. |
@@ -176,7 +176,7 @@ static void i3200_get_and_clear_error_info(struct mem_ctl_info *mci, | |||
176 | struct i3200_priv *priv = mci->pvt_info; | 176 | struct i3200_priv *priv = mci->pvt_info; |
177 | void __iomem *window = priv->window; | 177 | void __iomem *window = priv->window; |
178 | 178 | ||
179 | pdev = to_pci_dev(mci->dev); | 179 | pdev = to_pci_dev(mci->pdev); |
180 | 180 | ||
181 | /* | 181 | /* |
182 | * This is a mess because there is no atomic way to read all the | 182 | * This is a mess because there is no atomic way to read all the |
@@ -218,25 +218,25 @@ static void i3200_process_error_info(struct mem_ctl_info *mci, | |||
218 | return; | 218 | return; |
219 | 219 | ||
220 | if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) { | 220 | if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) { |
221 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0, | 221 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, 0, 0, 0, |
222 | -1, -1, -1, "UE overwrote CE", "", NULL); | 222 | -1, -1, -1, "UE overwrote CE", ""); |
223 | info->errsts = info->errsts2; | 223 | info->errsts = info->errsts2; |
224 | } | 224 | } |
225 | 225 | ||
226 | for (channel = 0; channel < nr_channels; channel++) { | 226 | for (channel = 0; channel < nr_channels; channel++) { |
227 | log = info->eccerrlog[channel]; | 227 | log = info->eccerrlog[channel]; |
228 | if (log & I3200_ECCERRLOG_UE) { | 228 | if (log & I3200_ECCERRLOG_UE) { |
229 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, | 229 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, |
230 | 0, 0, 0, | 230 | 0, 0, 0, |
231 | eccerrlog_row(channel, log), | 231 | eccerrlog_row(channel, log), |
232 | -1, -1, | 232 | -1, -1, |
233 | "i3000 UE", "", NULL); | 233 | "i3000 UE", ""); |
234 | } else if (log & I3200_ECCERRLOG_CE) { | 234 | } else if (log & I3200_ECCERRLOG_CE) { |
235 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, | 235 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 1, |
236 | 0, 0, eccerrlog_syndrome(log), | 236 | 0, 0, eccerrlog_syndrome(log), |
237 | eccerrlog_row(channel, log), | 237 | eccerrlog_row(channel, log), |
238 | -1, -1, | 238 | -1, -1, |
239 | "i3000 UE", "", NULL); | 239 | "i3000 UE", ""); |
240 | } | 240 | } |
241 | } | 241 | } |
242 | } | 242 | } |
@@ -245,7 +245,7 @@ static void i3200_check(struct mem_ctl_info *mci) | |||
245 | { | 245 | { |
246 | struct i3200_error_info info; | 246 | struct i3200_error_info info; |
247 | 247 | ||
248 | debugf1("MC%d: %s()\n", mci->mc_idx, __func__); | 248 | edac_dbg(1, "MC%d\n", mci->mc_idx); |
249 | i3200_get_and_clear_error_info(mci, &info); | 249 | i3200_get_and_clear_error_info(mci, &info); |
250 | i3200_process_error_info(mci, &info); | 250 | i3200_process_error_info(mci, &info); |
251 | } | 251 | } |
@@ -332,7 +332,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
332 | void __iomem *window; | 332 | void __iomem *window; |
333 | struct i3200_priv *priv; | 333 | struct i3200_priv *priv; |
334 | 334 | ||
335 | debugf0("MC: %s()\n", __func__); | 335 | edac_dbg(0, "MC:\n"); |
336 | 336 | ||
337 | window = i3200_map_mchbar(pdev); | 337 | window = i3200_map_mchbar(pdev); |
338 | if (!window) | 338 | if (!window) |
@@ -352,9 +352,9 @@ static int i3200_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; |
@@ -379,7 +379,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
379 | */ | 379 | */ |
380 | for (i = 0; i < mci->nr_csrows; i++) { | 380 | for (i = 0; i < mci->nr_csrows; i++) { |
381 | unsigned long nr_pages; | 381 | unsigned long nr_pages; |
382 | struct csrow_info *csrow = &mci->csrows[i]; | 382 | struct csrow_info *csrow = mci->csrows[i]; |
383 | 383 | ||
384 | nr_pages = drb_to_nr_pages(drbs, stacked, | 384 | nr_pages = drb_to_nr_pages(drbs, stacked, |
385 | i / I3200_RANKS_PER_CHANNEL, | 385 | i / I3200_RANKS_PER_CHANNEL, |
@@ -389,7 +389,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
389 | continue; | 389 | continue; |
390 | 390 | ||
391 | for (j = 0; j < nr_channels; j++) { | 391 | for (j = 0; j < nr_channels; j++) { |
392 | struct dimm_info *dimm = csrow->channels[j].dimm; | 392 | struct dimm_info *dimm = csrow->channels[j]->dimm; |
393 | 393 | ||
394 | dimm->nr_pages = nr_pages / nr_channels; | 394 | dimm->nr_pages = nr_pages / nr_channels; |
395 | dimm->grain = nr_pages << PAGE_SHIFT; | 395 | dimm->grain = nr_pages << PAGE_SHIFT; |
@@ -403,12 +403,12 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
403 | 403 | ||
404 | rc = -ENODEV; | 404 | rc = -ENODEV; |
405 | if (edac_mc_add_mc(mci)) { | 405 | if (edac_mc_add_mc(mci)) { |
406 | debugf3("MC: %s(): failed edac_mc_add_mc()\n", __func__); | 406 | edac_dbg(3, "MC: failed edac_mc_add_mc()\n"); |
407 | goto fail; | 407 | goto fail; |
408 | } | 408 | } |
409 | 409 | ||
410 | /* get this far and it's successful */ | 410 | /* get this far and it's successful */ |
411 | debugf3("MC: %s(): success\n", __func__); | 411 | edac_dbg(3, "MC: success\n"); |
412 | return 0; | 412 | return 0; |
413 | 413 | ||
414 | fail: | 414 | fail: |
@@ -424,7 +424,7 @@ static int __devinit i3200_init_one(struct pci_dev *pdev, | |||
424 | { | 424 | { |
425 | int rc; | 425 | int rc; |
426 | 426 | ||
427 | debugf0("MC: %s()\n", __func__); | 427 | edac_dbg(0, "MC:\n"); |
428 | 428 | ||
429 | if (pci_enable_device(pdev) < 0) | 429 | if (pci_enable_device(pdev) < 0) |
430 | return -EIO; | 430 | return -EIO; |
@@ -441,7 +441,7 @@ static void __devexit i3200_remove_one(struct pci_dev *pdev) | |||
441 | struct mem_ctl_info *mci; | 441 | struct mem_ctl_info *mci; |
442 | struct i3200_priv *priv; | 442 | struct i3200_priv *priv; |
443 | 443 | ||
444 | debugf0("%s()\n", __func__); | 444 | edac_dbg(0, "\n"); |
445 | 445 | ||
446 | mci = edac_mc_del_mc(&pdev->dev); | 446 | mci = edac_mc_del_mc(&pdev->dev); |
447 | if (!mci) | 447 | if (!mci) |
@@ -475,7 +475,7 @@ static int __init i3200_init(void) | |||
475 | { | 475 | { |
476 | int pci_rc; | 476 | int pci_rc; |
477 | 477 | ||
478 | debugf3("MC: %s()\n", __func__); | 478 | edac_dbg(3, "MC:\n"); |
479 | 479 | ||
480 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ | 480 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ |
481 | opstate_init(); | 481 | opstate_init(); |
@@ -489,14 +489,14 @@ static int __init i3200_init(void) | |||
489 | mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 489 | mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
490 | PCI_DEVICE_ID_INTEL_3200_HB, NULL); | 490 | PCI_DEVICE_ID_INTEL_3200_HB, NULL); |
491 | if (!mci_pdev) { | 491 | if (!mci_pdev) { |
492 | debugf0("i3200 pci_get_device fail\n"); | 492 | edac_dbg(0, "i3200 pci_get_device fail\n"); |
493 | pci_rc = -ENODEV; | 493 | pci_rc = -ENODEV; |
494 | goto fail1; | 494 | goto fail1; |
495 | } | 495 | } |
496 | 496 | ||
497 | pci_rc = i3200_init_one(mci_pdev, i3200_pci_tbl); | 497 | pci_rc = i3200_init_one(mci_pdev, i3200_pci_tbl); |
498 | if (pci_rc < 0) { | 498 | if (pci_rc < 0) { |
499 | debugf0("i3200 init fail\n"); | 499 | edac_dbg(0, "i3200 init fail\n"); |
500 | pci_rc = -ENODEV; | 500 | pci_rc = -ENODEV; |
501 | goto fail1; | 501 | goto fail1; |
502 | } | 502 | } |
@@ -516,7 +516,7 @@ fail0: | |||
516 | 516 | ||
517 | static void __exit i3200_exit(void) | 517 | static void __exit i3200_exit(void) |
518 | { | 518 | { |
519 | debugf3("MC: %s()\n", __func__); | 519 | edac_dbg(3, "MC:\n"); |
520 | 520 | ||
521 | pci_unregister_driver(&i3200_driver); | 521 | pci_unregister_driver(&i3200_driver); |
522 | if (!i3200_registered) { | 522 | if (!i3200_registered) { |