diff options
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r-- | drivers/edac/edac_mc.c | 186 |
1 files changed, 85 insertions, 101 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 8a7a3ab745aa..499ac90ad67e 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | #include "edac_mc.h" | 38 | #include "edac_mc.h" |
39 | 39 | ||
40 | #define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__ | 40 | #define EDAC_MC_VERSION "Ver: 2.0.0 " __DATE__ |
41 | 41 | ||
42 | /* For now, disable the EDAC sysfs code. The sysfs interface that EDAC | 42 | /* For now, disable the EDAC sysfs code. The sysfs interface that EDAC |
43 | * presents to user space needs more thought, and is likely to change | 43 | * presents to user space needs more thought, and is likely to change |
@@ -243,7 +243,7 @@ static struct memctrl_dev_attribute *memctrl_attr[] = { | |||
243 | /* Main MC kobject release() function */ | 243 | /* Main MC kobject release() function */ |
244 | static void edac_memctrl_master_release(struct kobject *kobj) | 244 | static void edac_memctrl_master_release(struct kobject *kobj) |
245 | { | 245 | { |
246 | debugf1("EDAC MC: " __FILE__ ": %s()\n", __func__); | 246 | debugf1("%s()\n", __func__); |
247 | } | 247 | } |
248 | 248 | ||
249 | static struct kobj_type ktype_memctrl = { | 249 | static struct kobj_type ktype_memctrl = { |
@@ -271,7 +271,7 @@ static int edac_sysfs_memctrl_setup(void) | |||
271 | { | 271 | { |
272 | int err=0; | 272 | int err=0; |
273 | 273 | ||
274 | debugf1("MC: " __FILE__ ": %s()\n", __func__); | 274 | debugf1("%s()\n", __func__); |
275 | 275 | ||
276 | /* create the /sys/devices/system/edac directory */ | 276 | /* create the /sys/devices/system/edac directory */ |
277 | err = sysdev_class_register(&edac_class); | 277 | err = sysdev_class_register(&edac_class); |
@@ -295,7 +295,7 @@ static int edac_sysfs_memctrl_setup(void) | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | } else { | 297 | } else { |
298 | debugf1(KERN_WARNING "__FILE__ %s() error=%d\n", __func__,err); | 298 | debugf1("%s() error=%d\n", __func__, err); |
299 | } | 299 | } |
300 | 300 | ||
301 | return err; | 301 | return err; |
@@ -567,7 +567,7 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = { | |||
567 | /* No memory to release */ | 567 | /* No memory to release */ |
568 | static void edac_pci_release(struct kobject *kobj) | 568 | static void edac_pci_release(struct kobject *kobj) |
569 | { | 569 | { |
570 | debugf1("EDAC PCI: " __FILE__ ": %s()\n", __func__); | 570 | debugf1("%s()\n", __func__); |
571 | } | 571 | } |
572 | 572 | ||
573 | static struct kobj_type ktype_edac_pci = { | 573 | static struct kobj_type ktype_edac_pci = { |
@@ -591,7 +591,7 @@ static int edac_sysfs_pci_setup(void) | |||
591 | { | 591 | { |
592 | int err; | 592 | int err; |
593 | 593 | ||
594 | debugf1("MC: " __FILE__ ": %s()\n", __func__); | 594 | debugf1("%s()\n", __func__); |
595 | 595 | ||
596 | memset(&edac_pci_kobj, 0, sizeof(edac_pci_kobj)); | 596 | memset(&edac_pci_kobj, 0, sizeof(edac_pci_kobj)); |
597 | 597 | ||
@@ -616,7 +616,7 @@ static int edac_sysfs_pci_setup(void) | |||
616 | static void edac_sysfs_pci_teardown(void) | 616 | static void edac_sysfs_pci_teardown(void) |
617 | { | 617 | { |
618 | #ifndef DISABLE_EDAC_SYSFS | 618 | #ifndef DISABLE_EDAC_SYSFS |
619 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 619 | debugf0("%s()\n", __func__); |
620 | 620 | ||
621 | kobject_unregister(&edac_pci_kobj); | 621 | kobject_unregister(&edac_pci_kobj); |
622 | kobject_put(&edac_pci_kobj); | 622 | kobject_put(&edac_pci_kobj); |
@@ -808,7 +808,7 @@ static struct csrowdev_attribute *csrow_attr[] = { | |||
808 | /* No memory to release */ | 808 | /* No memory to release */ |
809 | static void edac_csrow_instance_release(struct kobject *kobj) | 809 | static void edac_csrow_instance_release(struct kobject *kobj) |
810 | { | 810 | { |
811 | debugf1("EDAC MC: " __FILE__ ": %s()\n", __func__); | 811 | debugf1("%s()\n", __func__); |
812 | } | 812 | } |
813 | 813 | ||
814 | static struct kobj_type ktype_csrow = { | 814 | static struct kobj_type ktype_csrow = { |
@@ -823,7 +823,7 @@ static int edac_create_csrow_object(struct kobject *edac_mci_kobj, | |||
823 | { | 823 | { |
824 | int err = 0; | 824 | int err = 0; |
825 | 825 | ||
826 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 826 | debugf0("%s()\n", __func__); |
827 | 827 | ||
828 | memset(&csrow->kobj, 0, sizeof(csrow->kobj)); | 828 | memset(&csrow->kobj, 0, sizeof(csrow->kobj)); |
829 | 829 | ||
@@ -1066,8 +1066,7 @@ static void edac_mci_instance_release(struct kobject *kobj) | |||
1066 | struct mem_ctl_info *mci; | 1066 | struct mem_ctl_info *mci; |
1067 | mci = container_of(kobj,struct mem_ctl_info,edac_mci_kobj); | 1067 | mci = container_of(kobj,struct mem_ctl_info,edac_mci_kobj); |
1068 | 1068 | ||
1069 | debugf0("MC: " __FILE__ ": %s() idx=%d calling kfree\n", | 1069 | debugf0("%s() idx=%d calling kfree\n", __func__, mci->mc_idx); |
1070 | __func__, mci->mc_idx); | ||
1071 | 1070 | ||
1072 | kfree(mci); | 1071 | kfree(mci); |
1073 | } | 1072 | } |
@@ -1102,7 +1101,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) | |||
1102 | struct csrow_info *csrow; | 1101 | struct csrow_info *csrow; |
1103 | struct kobject *edac_mci_kobj=&mci->edac_mci_kobj; | 1102 | struct kobject *edac_mci_kobj=&mci->edac_mci_kobj; |
1104 | 1103 | ||
1105 | debugf0("MC: " __FILE__ ": %s() idx=%d\n", __func__, mci->mc_idx); | 1104 | debugf0("%s() idx=%d\n", __func__, mci->mc_idx); |
1106 | 1105 | ||
1107 | memset(edac_mci_kobj, 0, sizeof(*edac_mci_kobj)); | 1106 | memset(edac_mci_kobj, 0, sizeof(*edac_mci_kobj)); |
1108 | kobject_init(edac_mci_kobj); | 1107 | kobject_init(edac_mci_kobj); |
@@ -1174,7 +1173,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) | |||
1174 | #ifndef DISABLE_EDAC_SYSFS | 1173 | #ifndef DISABLE_EDAC_SYSFS |
1175 | int i; | 1174 | int i; |
1176 | 1175 | ||
1177 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 1176 | debugf0("%s()\n", __func__); |
1178 | 1177 | ||
1179 | /* remove all csrow kobjects */ | 1178 | /* remove all csrow kobjects */ |
1180 | for (i = 0; i < mci->nr_csrows; i++) { | 1179 | for (i = 0; i < mci->nr_csrows; i++) { |
@@ -1396,7 +1395,7 @@ struct mem_ctl_info *edac_mc_find_mci_by_pdev(struct pci_dev *pdev) | |||
1396 | struct mem_ctl_info *mci; | 1395 | struct mem_ctl_info *mci; |
1397 | struct list_head *item; | 1396 | struct list_head *item; |
1398 | 1397 | ||
1399 | debugf3("MC: " __FILE__ ": %s()\n", __func__); | 1398 | debugf3("%s()\n", __func__); |
1400 | 1399 | ||
1401 | list_for_each(item, &mc_devices) { | 1400 | list_for_each(item, &mc_devices) { |
1402 | mci = list_entry(item, struct mem_ctl_info, link); | 1401 | mci = list_entry(item, struct mem_ctl_info, link); |
@@ -1419,10 +1418,11 @@ static int add_mc_to_global_list (struct mem_ctl_info *mci) | |||
1419 | insert_before = &mc_devices; | 1418 | insert_before = &mc_devices; |
1420 | } else { | 1419 | } else { |
1421 | if (edac_mc_find_mci_by_pdev(mci->pdev)) { | 1420 | if (edac_mc_find_mci_by_pdev(mci->pdev)) { |
1422 | printk(KERN_WARNING | 1421 | edac_printk(KERN_WARNING, EDAC_MC, |
1423 | "EDAC MC: %s (%s) %s %s already assigned %d\n", | 1422 | "%s (%s) %s %s already assigned %d\n", |
1424 | mci->pdev->dev.bus_id, pci_name(mci->pdev), | 1423 | mci->pdev->dev.bus_id, |
1425 | mci->mod_name, mci->ctl_name, mci->mc_idx); | 1424 | pci_name(mci->pdev), mci->mod_name, |
1425 | mci->ctl_name, mci->mc_idx); | ||
1426 | return 1; | 1426 | return 1; |
1427 | } | 1427 | } |
1428 | 1428 | ||
@@ -1468,7 +1468,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) | |||
1468 | { | 1468 | { |
1469 | int rc = 1; | 1469 | int rc = 1; |
1470 | 1470 | ||
1471 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 1471 | debugf0("%s()\n", __func__); |
1472 | #ifdef CONFIG_EDAC_DEBUG | 1472 | #ifdef CONFIG_EDAC_DEBUG |
1473 | if (edac_debug_level >= 3) | 1473 | if (edac_debug_level >= 3) |
1474 | edac_mc_dump_mci(mci); | 1474 | edac_mc_dump_mci(mci); |
@@ -1493,19 +1493,15 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) | |||
1493 | mci->start_time = jiffies; | 1493 | mci->start_time = jiffies; |
1494 | 1494 | ||
1495 | if (edac_create_sysfs_mci_device(mci)) { | 1495 | if (edac_create_sysfs_mci_device(mci)) { |
1496 | printk(KERN_WARNING | 1496 | edac_mc_printk(mci, KERN_WARNING, |
1497 | "EDAC MC%d: failed to create sysfs device\n", | 1497 | "failed to create sysfs device\n"); |
1498 | mci->mc_idx); | ||
1499 | /* FIXME - should there be an error code and unwind? */ | 1498 | /* FIXME - should there be an error code and unwind? */ |
1500 | goto finish; | 1499 | goto finish; |
1501 | } | 1500 | } |
1502 | 1501 | ||
1503 | /* Report action taken */ | 1502 | /* Report action taken */ |
1504 | printk(KERN_INFO | 1503 | edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: PCI %s\n", |
1505 | "EDAC MC%d: Giving out device to %s %s: PCI %s\n", | 1504 | mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); |
1506 | mci->mc_idx, mci->mod_name, mci->ctl_name, | ||
1507 | pci_name(mci->pdev)); | ||
1508 | |||
1509 | 1505 | ||
1510 | rc = 0; | 1506 | rc = 0; |
1511 | 1507 | ||
@@ -1547,13 +1543,12 @@ int edac_mc_del_mc(struct mem_ctl_info *mci) | |||
1547 | { | 1543 | { |
1548 | int rc = 1; | 1544 | int rc = 1; |
1549 | 1545 | ||
1550 | debugf0("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); | 1546 | debugf0("MC%d: %s()\n", mci->mc_idx, __func__); |
1551 | down(&mem_ctls_mutex); | 1547 | down(&mem_ctls_mutex); |
1552 | del_mc_from_global_list(mci); | 1548 | del_mc_from_global_list(mci); |
1553 | printk(KERN_INFO | 1549 | edac_printk(KERN_INFO, EDAC_MC, |
1554 | "EDAC MC%d: Removed device %d for %s %s: PCI %s\n", | 1550 | "Removed device %d for %s %s: PCI %s\n", mci->mc_idx, |
1555 | mci->mc_idx, mci->mc_idx, mci->mod_name, mci->ctl_name, | 1551 | mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); |
1556 | pci_name(mci->pdev)); | ||
1557 | rc = 0; | 1552 | rc = 0; |
1558 | up(&mem_ctls_mutex); | 1553 | up(&mem_ctls_mutex); |
1559 | 1554 | ||
@@ -1570,7 +1565,7 @@ void edac_mc_scrub_block(unsigned long page, unsigned long offset, | |||
1570 | void *virt_addr; | 1565 | void *virt_addr; |
1571 | unsigned long flags = 0; | 1566 | unsigned long flags = 0; |
1572 | 1567 | ||
1573 | debugf3("MC: " __FILE__ ": %s()\n", __func__); | 1568 | debugf3("%s()\n", __func__); |
1574 | 1569 | ||
1575 | /* ECC error page was not in our memory. Ignore it. */ | 1570 | /* ECC error page was not in our memory. Ignore it. */ |
1576 | if(!pfn_valid(page)) | 1571 | if(!pfn_valid(page)) |
@@ -1604,8 +1599,7 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, | |||
1604 | struct csrow_info *csrows = mci->csrows; | 1599 | struct csrow_info *csrows = mci->csrows; |
1605 | int row, i; | 1600 | int row, i; |
1606 | 1601 | ||
1607 | debugf1("MC%d: " __FILE__ ": %s(): 0x%lx\n", mci->mc_idx, __func__, | 1602 | debugf1("MC%d: %s(): 0x%lx\n", mci->mc_idx, __func__, page); |
1608 | page); | ||
1609 | row = -1; | 1603 | row = -1; |
1610 | 1604 | ||
1611 | for (i = 0; i < mci->nr_csrows; i++) { | 1605 | for (i = 0; i < mci->nr_csrows; i++) { |
@@ -1614,11 +1608,10 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, | |||
1614 | if (csrow->nr_pages == 0) | 1608 | if (csrow->nr_pages == 0) |
1615 | continue; | 1609 | continue; |
1616 | 1610 | ||
1617 | debugf3("MC%d: " __FILE__ | 1611 | debugf3("MC%d: %s(): first(0x%lx) page(0x%lx) last(0x%lx) " |
1618 | ": %s(): first(0x%lx) page(0x%lx)" | 1612 | "mask(0x%lx)\n", mci->mc_idx, __func__, |
1619 | " last(0x%lx) mask(0x%lx)\n", mci->mc_idx, | 1613 | csrow->first_page, page, csrow->last_page, |
1620 | __func__, csrow->first_page, page, | 1614 | csrow->page_mask); |
1621 | csrow->last_page, csrow->page_mask); | ||
1622 | 1615 | ||
1623 | if ((page >= csrow->first_page) && | 1616 | if ((page >= csrow->first_page) && |
1624 | (page <= csrow->last_page) && | 1617 | (page <= csrow->last_page) && |
@@ -1630,9 +1623,9 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, | |||
1630 | } | 1623 | } |
1631 | 1624 | ||
1632 | if (row == -1) | 1625 | if (row == -1) |
1633 | printk(KERN_ERR | 1626 | edac_mc_printk(mci, KERN_ERR, |
1634 | "EDAC MC%d: could not look up page error address %lx\n", | 1627 | "could not look up page error address %lx\n", |
1635 | mci->mc_idx, (unsigned long) page); | 1628 | (unsigned long) page); |
1636 | 1629 | ||
1637 | return row; | 1630 | return row; |
1638 | } | 1631 | } |
@@ -1650,36 +1643,35 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
1650 | { | 1643 | { |
1651 | unsigned long remapped_page; | 1644 | unsigned long remapped_page; |
1652 | 1645 | ||
1653 | debugf3("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); | 1646 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); |
1654 | 1647 | ||
1655 | /* FIXME - maybe make panic on INTERNAL ERROR an option */ | 1648 | /* FIXME - maybe make panic on INTERNAL ERROR an option */ |
1656 | if (row >= mci->nr_csrows || row < 0) { | 1649 | if (row >= mci->nr_csrows || row < 0) { |
1657 | /* something is wrong */ | 1650 | /* something is wrong */ |
1658 | printk(KERN_ERR | 1651 | edac_mc_printk(mci, KERN_ERR, |
1659 | "EDAC MC%d: INTERNAL ERROR: row out of range (%d >= %d)\n", | 1652 | "INTERNAL ERROR: row out of range " |
1660 | mci->mc_idx, row, mci->nr_csrows); | 1653 | "(%d >= %d)\n", row, mci->nr_csrows); |
1661 | edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); | 1654 | edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); |
1662 | return; | 1655 | return; |
1663 | } | 1656 | } |
1664 | if (channel >= mci->csrows[row].nr_channels || channel < 0) { | 1657 | if (channel >= mci->csrows[row].nr_channels || channel < 0) { |
1665 | /* something is wrong */ | 1658 | /* something is wrong */ |
1666 | printk(KERN_ERR | 1659 | edac_mc_printk(mci, KERN_ERR, |
1667 | "EDAC MC%d: INTERNAL ERROR: channel out of range " | 1660 | "INTERNAL ERROR: channel out of range " |
1668 | "(%d >= %d)\n", | 1661 | "(%d >= %d)\n", channel, |
1669 | mci->mc_idx, channel, mci->csrows[row].nr_channels); | 1662 | mci->csrows[row].nr_channels); |
1670 | edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); | 1663 | edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); |
1671 | return; | 1664 | return; |
1672 | } | 1665 | } |
1673 | 1666 | ||
1674 | if (log_ce) | 1667 | if (log_ce) |
1675 | /* FIXME - put in DIMM location */ | 1668 | /* FIXME - put in DIMM location */ |
1676 | printk(KERN_WARNING | 1669 | edac_mc_printk(mci, KERN_WARNING, |
1677 | "EDAC MC%d: CE page 0x%lx, offset 0x%lx," | 1670 | "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " |
1678 | " grain %d, syndrome 0x%lx, row %d, channel %d," | 1671 | "0x%lx, row %d, channel %d, label \"%s\": %s\n", |
1679 | " label \"%s\": %s\n", mci->mc_idx, | 1672 | page_frame_number, offset_in_page, |
1680 | page_frame_number, offset_in_page, | 1673 | mci->csrows[row].grain, syndrome, row, channel, |
1681 | mci->csrows[row].grain, syndrome, row, channel, | 1674 | mci->csrows[row].channels[channel].label, msg); |
1682 | mci->csrows[row].channels[channel].label, msg); | ||
1683 | 1675 | ||
1684 | mci->ce_count++; | 1676 | mci->ce_count++; |
1685 | mci->csrows[row].ce_count++; | 1677 | mci->csrows[row].ce_count++; |
@@ -1711,9 +1703,8 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, | |||
1711 | const char *msg) | 1703 | const char *msg) |
1712 | { | 1704 | { |
1713 | if (log_ce) | 1705 | if (log_ce) |
1714 | printk(KERN_WARNING | 1706 | edac_mc_printk(mci, KERN_WARNING, |
1715 | "EDAC MC%d: CE - no information available: %s\n", | 1707 | "CE - no information available: %s\n", msg); |
1716 | mci->mc_idx, msg); | ||
1717 | mci->ce_noinfo_count++; | 1708 | mci->ce_noinfo_count++; |
1718 | mci->ce_count++; | 1709 | mci->ce_count++; |
1719 | } | 1710 | } |
@@ -1732,14 +1723,14 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
1732 | int chan; | 1723 | int chan; |
1733 | int chars; | 1724 | int chars; |
1734 | 1725 | ||
1735 | debugf3("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); | 1726 | debugf3("MC%d: %s()\n", mci->mc_idx, __func__); |
1736 | 1727 | ||
1737 | /* FIXME - maybe make panic on INTERNAL ERROR an option */ | 1728 | /* FIXME - maybe make panic on INTERNAL ERROR an option */ |
1738 | if (row >= mci->nr_csrows || row < 0) { | 1729 | if (row >= mci->nr_csrows || row < 0) { |
1739 | /* something is wrong */ | 1730 | /* something is wrong */ |
1740 | printk(KERN_ERR | 1731 | edac_mc_printk(mci, KERN_ERR, |
1741 | "EDAC MC%d: INTERNAL ERROR: row out of range (%d >= %d)\n", | 1732 | "INTERNAL ERROR: row out of range " |
1742 | mci->mc_idx, row, mci->nr_csrows); | 1733 | "(%d >= %d)\n", row, mci->nr_csrows); |
1743 | edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); | 1734 | edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); |
1744 | return; | 1735 | return; |
1745 | } | 1736 | } |
@@ -1757,11 +1748,11 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
1757 | } | 1748 | } |
1758 | 1749 | ||
1759 | if (log_ue) | 1750 | if (log_ue) |
1760 | printk(KERN_EMERG | 1751 | edac_mc_printk(mci, KERN_EMERG, |
1761 | "EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, row %d," | 1752 | "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " |
1762 | " labels \"%s\": %s\n", mci->mc_idx, | 1753 | "labels \"%s\": %s\n", page_frame_number, |
1763 | page_frame_number, offset_in_page, | 1754 | offset_in_page, mci->csrows[row].grain, row, labels, |
1764 | mci->csrows[row].grain, row, labels, msg); | 1755 | msg); |
1765 | 1756 | ||
1766 | if (panic_on_ue) | 1757 | if (panic_on_ue) |
1767 | panic | 1758 | panic |
@@ -1784,9 +1775,8 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, | |||
1784 | panic("EDAC MC%d: Uncorrected Error", mci->mc_idx); | 1775 | panic("EDAC MC%d: Uncorrected Error", mci->mc_idx); |
1785 | 1776 | ||
1786 | if (log_ue) | 1777 | if (log_ue) |
1787 | printk(KERN_WARNING | 1778 | edac_mc_printk(mci, KERN_WARNING, |
1788 | "EDAC MC%d: UE - no information available: %s\n", | 1779 | "UE - no information available: %s\n", msg); |
1789 | mci->mc_idx, msg); | ||
1790 | mci->ue_noinfo_count++; | 1780 | mci->ue_noinfo_count++; |
1791 | mci->ue_count++; | 1781 | mci->ue_count++; |
1792 | } | 1782 | } |
@@ -1856,25 +1846,22 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) | |||
1856 | /* check the status reg for errors */ | 1846 | /* check the status reg for errors */ |
1857 | if (status) { | 1847 | if (status) { |
1858 | if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) | 1848 | if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) |
1859 | printk(KERN_CRIT | 1849 | edac_printk(KERN_CRIT, EDAC_PCI, |
1860 | "EDAC PCI- " | ||
1861 | "Signaled System Error on %s\n", | 1850 | "Signaled System Error on %s\n", |
1862 | pci_name (dev)); | 1851 | pci_name(dev)); |
1863 | 1852 | ||
1864 | if (status & (PCI_STATUS_PARITY)) { | 1853 | if (status & (PCI_STATUS_PARITY)) { |
1865 | printk(KERN_CRIT | 1854 | edac_printk(KERN_CRIT, EDAC_PCI, |
1866 | "EDAC PCI- " | ||
1867 | "Master Data Parity Error on %s\n", | 1855 | "Master Data Parity Error on %s\n", |
1868 | pci_name (dev)); | 1856 | pci_name(dev)); |
1869 | 1857 | ||
1870 | atomic_inc(&pci_parity_count); | 1858 | atomic_inc(&pci_parity_count); |
1871 | } | 1859 | } |
1872 | 1860 | ||
1873 | if (status & (PCI_STATUS_DETECTED_PARITY)) { | 1861 | if (status & (PCI_STATUS_DETECTED_PARITY)) { |
1874 | printk(KERN_CRIT | 1862 | edac_printk(KERN_CRIT, EDAC_PCI, |
1875 | "EDAC PCI- " | ||
1876 | "Detected Parity Error on %s\n", | 1863 | "Detected Parity Error on %s\n", |
1877 | pci_name (dev)); | 1864 | pci_name(dev)); |
1878 | 1865 | ||
1879 | atomic_inc(&pci_parity_count); | 1866 | atomic_inc(&pci_parity_count); |
1880 | } | 1867 | } |
@@ -1895,25 +1882,22 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev) | |||
1895 | /* check the secondary status reg for errors */ | 1882 | /* check the secondary status reg for errors */ |
1896 | if (status) { | 1883 | if (status) { |
1897 | if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) | 1884 | if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) |
1898 | printk(KERN_CRIT | 1885 | edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " |
1899 | "EDAC PCI-Bridge- " | ||
1900 | "Signaled System Error on %s\n", | 1886 | "Signaled System Error on %s\n", |
1901 | pci_name (dev)); | 1887 | pci_name(dev)); |
1902 | 1888 | ||
1903 | if (status & (PCI_STATUS_PARITY)) { | 1889 | if (status & (PCI_STATUS_PARITY)) { |
1904 | printk(KERN_CRIT | 1890 | edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " |
1905 | "EDAC PCI-Bridge- " | 1891 | "Master Data Parity Error on " |
1906 | "Master Data Parity Error on %s\n", | 1892 | "%s\n", pci_name(dev)); |
1907 | pci_name (dev)); | ||
1908 | 1893 | ||
1909 | atomic_inc(&pci_parity_count); | 1894 | atomic_inc(&pci_parity_count); |
1910 | } | 1895 | } |
1911 | 1896 | ||
1912 | if (status & (PCI_STATUS_DETECTED_PARITY)) { | 1897 | if (status & (PCI_STATUS_DETECTED_PARITY)) { |
1913 | printk(KERN_CRIT | 1898 | edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " |
1914 | "EDAC PCI-Bridge- " | ||
1915 | "Detected Parity Error on %s\n", | 1899 | "Detected Parity Error on %s\n", |
1916 | pci_name (dev)); | 1900 | pci_name(dev)); |
1917 | 1901 | ||
1918 | atomic_inc(&pci_parity_count); | 1902 | atomic_inc(&pci_parity_count); |
1919 | } | 1903 | } |
@@ -1992,7 +1976,7 @@ static void do_pci_parity_check(void) | |||
1992 | unsigned long flags; | 1976 | unsigned long flags; |
1993 | int before_count; | 1977 | int before_count; |
1994 | 1978 | ||
1995 | debugf3("MC: " __FILE__ ": %s()\n", __func__); | 1979 | debugf3("%s()\n", __func__); |
1996 | 1980 | ||
1997 | if (!check_pci_parity) | 1981 | if (!check_pci_parity) |
1998 | return; | 1982 | return; |
@@ -2050,7 +2034,7 @@ static inline void check_mc_devices (void) | |||
2050 | struct list_head *item; | 2034 | struct list_head *item; |
2051 | struct mem_ctl_info *mci; | 2035 | struct mem_ctl_info *mci; |
2052 | 2036 | ||
2053 | debugf3("MC: " __FILE__ ": %s()\n", __func__); | 2037 | debugf3("%s()\n", __func__); |
2054 | 2038 | ||
2055 | /* during poll, have interrupts off */ | 2039 | /* during poll, have interrupts off */ |
2056 | local_irq_save(flags); | 2040 | local_irq_save(flags); |
@@ -2076,10 +2060,8 @@ static inline void check_mc_devices (void) | |||
2076 | */ | 2060 | */ |
2077 | static void do_edac_check(void) | 2061 | static void do_edac_check(void) |
2078 | { | 2062 | { |
2079 | debugf3("MC: " __FILE__ ": %s()\n", __func__); | 2063 | debugf3("%s()\n", __func__); |
2080 | |||
2081 | check_mc_devices(); | 2064 | check_mc_devices(); |
2082 | |||
2083 | do_pci_parity_check(); | 2065 | do_pci_parity_check(); |
2084 | } | 2066 | } |
2085 | 2067 | ||
@@ -2102,7 +2084,7 @@ static int edac_kernel_thread(void *arg) | |||
2102 | */ | 2084 | */ |
2103 | static int __init edac_mc_init(void) | 2085 | static int __init edac_mc_init(void) |
2104 | { | 2086 | { |
2105 | printk(KERN_INFO "MC: " __FILE__ " version " EDAC_MC_VERSION "\n"); | 2087 | edac_printk(KERN_INFO, EDAC_MC, EDAC_MC_VERSION "\n"); |
2106 | 2088 | ||
2107 | /* | 2089 | /* |
2108 | * Harvest and clear any boot/initialization PCI parity errors | 2090 | * Harvest and clear any boot/initialization PCI parity errors |
@@ -2118,14 +2100,16 @@ static int __init edac_mc_init(void) | |||
2118 | 2100 | ||
2119 | /* Create the MC sysfs entires */ | 2101 | /* Create the MC sysfs entires */ |
2120 | if (edac_sysfs_memctrl_setup()) { | 2102 | if (edac_sysfs_memctrl_setup()) { |
2121 | printk(KERN_ERR "EDAC MC: Error initializing sysfs code\n"); | 2103 | edac_printk(KERN_ERR, EDAC_MC, |
2104 | "Error initializing sysfs code\n"); | ||
2122 | return -ENODEV; | 2105 | return -ENODEV; |
2123 | } | 2106 | } |
2124 | 2107 | ||
2125 | /* Create the PCI parity sysfs entries */ | 2108 | /* Create the PCI parity sysfs entries */ |
2126 | if (edac_sysfs_pci_setup()) { | 2109 | if (edac_sysfs_pci_setup()) { |
2127 | edac_sysfs_memctrl_teardown(); | 2110 | edac_sysfs_memctrl_teardown(); |
2128 | printk(KERN_ERR "EDAC PCI: Error initializing sysfs code\n"); | 2111 | edac_printk(KERN_ERR, EDAC_MC, |
2112 | "EDAC PCI: Error initializing sysfs code\n"); | ||
2129 | return -ENODEV; | 2113 | return -ENODEV; |
2130 | } | 2114 | } |
2131 | 2115 | ||
@@ -2148,7 +2132,7 @@ static int __init edac_mc_init(void) | |||
2148 | */ | 2132 | */ |
2149 | static void __exit edac_mc_exit(void) | 2133 | static void __exit edac_mc_exit(void) |
2150 | { | 2134 | { |
2151 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 2135 | debugf0("%s()\n", __func__); |
2152 | 2136 | ||
2153 | kthread_stop(edac_thread); | 2137 | kthread_stop(edac_thread); |
2154 | 2138 | ||