aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i82875p_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/i82875p_edac.c')
-rw-r--r--drivers/edac/i82875p_edac.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 1991f94af753..0e22c66ee36c 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -26,6 +26,14 @@
26#include "edac_mc.h" 26#include "edac_mc.h"
27 27
28 28
29#define i82875p_printk(level, fmt, arg...) \
30 edac_printk(level, "i82875p", fmt, ##arg)
31
32
33#define i82875p_mc_printk(mci, level, fmt, arg...) \
34 edac_mc_chipset_printk(mci, level, "i82875p", fmt, ##arg)
35
36
29#ifndef PCI_DEVICE_ID_INTEL_82875_0 37#ifndef PCI_DEVICE_ID_INTEL_82875_0
30#define PCI_DEVICE_ID_INTEL_82875_0 0x2578 38#define PCI_DEVICE_ID_INTEL_82875_0 0x2578
31#endif /* PCI_DEVICE_ID_INTEL_82875_0 */ 39#endif /* PCI_DEVICE_ID_INTEL_82875_0 */
@@ -254,7 +262,7 @@ static void i82875p_check(struct mem_ctl_info *mci)
254{ 262{
255 struct i82875p_error_info info; 263 struct i82875p_error_info info;
256 264
257 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 265 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
258 i82875p_get_error_info(mci, &info); 266 i82875p_get_error_info(mci, &info);
259 i82875p_process_error_info(mci, &info, 1); 267 i82875p_process_error_info(mci, &info, 1);
260} 268}
@@ -279,7 +287,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
279 u32 nr_chans; 287 u32 nr_chans;
280 u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ 288 u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */
281 289
282 debugf0("MC: " __FILE__ ": %s()\n", __func__); 290 debugf0("%s()\n", __func__);
283 291
284 ovrfl_pdev = pci_find_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); 292 ovrfl_pdev = pci_find_device(PCI_VEND_DEV(INTEL, 82875_6), NULL);
285 293
@@ -298,16 +306,16 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
298 } 306 }
299#ifdef CONFIG_PROC_FS 307#ifdef CONFIG_PROC_FS
300 if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) { 308 if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) {
301 printk(KERN_ERR "MC: " __FILE__ 309 i82875p_printk(KERN_ERR,
302 ": %s(): Failed to attach overflow device\n", 310 "%s(): Failed to attach overflow device\n",
303 __func__); 311 __func__);
304 goto fail; 312 goto fail;
305 } 313 }
306#endif /* CONFIG_PROC_FS */ 314#endif /* CONFIG_PROC_FS */
307 if (pci_enable_device(ovrfl_pdev)) { 315 if (pci_enable_device(ovrfl_pdev)) {
308 printk(KERN_ERR "MC: " __FILE__ 316 i82875p_printk(KERN_ERR,
309 ": %s(): Failed to enable overflow device\n", 317 "%s(): Failed to enable overflow device\n",
310 __func__); 318 __func__);
311 goto fail; 319 goto fail;
312 } 320 }
313 321
@@ -321,8 +329,8 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
321 pci_resource_len(ovrfl_pdev, 0)); 329 pci_resource_len(ovrfl_pdev, 0));
322 330
323 if (!ovrfl_window) { 331 if (!ovrfl_window) {
324 printk(KERN_ERR "MC: " __FILE__ 332 i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n",
325 ": %s(): Failed to ioremap bar6\n", __func__); 333 __func__);
326 goto fail; 334 goto fail;
327 } 335 }
328 336
@@ -340,7 +348,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
340 goto fail; 348 goto fail;
341 } 349 }
342 350
343 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 351 debugf3("%s(): init mci\n", __func__);
344 352
345 mci->pdev = pdev; 353 mci->pdev = pdev;
346 mci->mtype_cap = MEM_FLAG_DDR; 354 mci->mtype_cap = MEM_FLAG_DDR;
@@ -355,7 +363,7 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
355 mci->edac_check = i82875p_check; 363 mci->edac_check = i82875p_check;
356 mci->ctl_page_to_phys = NULL; 364 mci->ctl_page_to_phys = NULL;
357 365
358 debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__); 366 debugf3("%s(): init pvt\n", __func__);
359 367
360 pvt = (struct i82875p_pvt *) mci->pvt_info; 368 pvt = (struct i82875p_pvt *) mci->pvt_info;
361 pvt->ovrfl_pdev = ovrfl_pdev; 369 pvt->ovrfl_pdev = ovrfl_pdev;
@@ -374,8 +382,8 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
374 382
375 value = readb(ovrfl_window + I82875P_DRB + index); 383 value = readb(ovrfl_window + I82875P_DRB + index);
376 cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT); 384 cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT);
377 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 385 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
378 __func__, index, cumul_size); 386 cumul_size);
379 if (cumul_size == last_cumul_size) 387 if (cumul_size == last_cumul_size)
380 continue; /* not populated */ 388 continue; /* not populated */
381 389
@@ -393,13 +401,12 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
393 pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081); 401 pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081);
394 402
395 if (edac_mc_add_mc(mci)) { 403 if (edac_mc_add_mc(mci)) {
396 debugf3("MC: " __FILE__ 404 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
397 ": %s(): failed edac_mc_add_mc()\n", __func__);
398 goto fail; 405 goto fail;
399 } 406 }
400 407
401 /* get this far and it's successful */ 408 /* get this far and it's successful */
402 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 409 debugf3("%s(): success\n", __func__);
403 return 0; 410 return 0;
404 411
405 fail: 412 fail:
@@ -425,9 +432,9 @@ static int __devinit i82875p_init_one(struct pci_dev *pdev,
425{ 432{
426 int rc; 433 int rc;
427 434
428 debugf0("MC: " __FILE__ ": %s()\n", __func__); 435 debugf0("%s()\n", __func__);
429 436
430 printk(KERN_INFO "i82875p init one\n"); 437 i82875p_printk(KERN_INFO, "i82875p init one\n");
431 if(pci_enable_device(pdev) < 0) 438 if(pci_enable_device(pdev) < 0)
432 return -EIO; 439 return -EIO;
433 rc = i82875p_probe1(pdev, ent->driver_data); 440 rc = i82875p_probe1(pdev, ent->driver_data);
@@ -442,7 +449,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
442 struct mem_ctl_info *mci; 449 struct mem_ctl_info *mci;
443 struct i82875p_pvt *pvt = NULL; 450 struct i82875p_pvt *pvt = NULL;
444 451
445 debugf0(__FILE__ ": %s()\n", __func__); 452 debugf0("%s()\n", __func__);
446 453
447 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL) 454 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
448 return; 455 return;
@@ -487,7 +494,7 @@ static int __init i82875p_init(void)
487{ 494{
488 int pci_rc; 495 int pci_rc;
489 496
490 debugf3("MC: " __FILE__ ": %s()\n", __func__); 497 debugf3("%s()\n", __func__);
491 pci_rc = pci_register_driver(&i82875p_driver); 498 pci_rc = pci_register_driver(&i82875p_driver);
492 if (pci_rc < 0) 499 if (pci_rc < 0)
493 return pci_rc; 500 return pci_rc;
@@ -513,7 +520,7 @@ static int __init i82875p_init(void)
513 520
514static void __exit i82875p_exit(void) 521static void __exit i82875p_exit(void)
515{ 522{
516 debugf3("MC: " __FILE__ ": %s()\n", __func__); 523 debugf3("%s()\n", __func__);
517 524
518 pci_unregister_driver(&i82875p_driver); 525 pci_unregister_driver(&i82875p_driver);
519 if (!i82875p_registered) { 526 if (!i82875p_registered) {