diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-04 12:38:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-12 11:15:48 -0400 |
commit | 00d18339276d35bc6b7ae6ae1a64ebf2242b89f6 (patch) | |
tree | 6dfaea8e622827dc7c61c6fa1b59deff34fea3f9 /drivers/edac | |
parent | 9eb07a7fb8a90ee39fa9d5489afc0330cfcfbea7 (diff) |
i7core_edac: properly handle error count
Instead of generating a burst of errors or reporting the error
count via driver-specific details, use the new way provided by
edac_mc_handle_error.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7core_edac.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index a95686e22416..a3c9a37b4cc1 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1536,18 +1536,6 @@ error: | |||
1536 | /**************************************************************************** | 1536 | /**************************************************************************** |
1537 | Error check routines | 1537 | Error check routines |
1538 | ****************************************************************************/ | 1538 | ****************************************************************************/ |
1539 | static void i7core_rdimm_update_errcount(struct mem_ctl_info *mci, | ||
1540 | const int chan, | ||
1541 | const int dimm, | ||
1542 | const int add) | ||
1543 | { | ||
1544 | int i; | ||
1545 | |||
1546 | for (i = 0; i < add; i++) { | ||
1547 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, 1, 0, 0, 0, | ||
1548 | chan, dimm, -1, "error", ""); | ||
1549 | } | ||
1550 | } | ||
1551 | 1539 | ||
1552 | static void i7core_rdimm_update_ce_count(struct mem_ctl_info *mci, | 1540 | static void i7core_rdimm_update_ce_count(struct mem_ctl_info *mci, |
1553 | const int chan, | 1541 | const int chan, |
@@ -1586,12 +1574,17 @@ static void i7core_rdimm_update_ce_count(struct mem_ctl_info *mci, | |||
1586 | 1574 | ||
1587 | /*updated the edac core */ | 1575 | /*updated the edac core */ |
1588 | if (add0 != 0) | 1576 | if (add0 != 0) |
1589 | i7core_rdimm_update_errcount(mci, chan, 0, add0); | 1577 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, add0, |
1578 | 0, 0, 0, | ||
1579 | chan, 0, -1, "error", ""); | ||
1590 | if (add1 != 0) | 1580 | if (add1 != 0) |
1591 | i7core_rdimm_update_errcount(mci, chan, 1, add1); | 1581 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, add1, |
1582 | 0, 0, 0, | ||
1583 | chan, 1, -1, "error", ""); | ||
1592 | if (add2 != 0) | 1584 | if (add2 != 0) |
1593 | i7core_rdimm_update_errcount(mci, chan, 2, add2); | 1585 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, add2, |
1594 | 1586 | 0, 0, 0, | |
1587 | chan, 2, -1, "error", ""); | ||
1595 | } | 1588 | } |
1596 | 1589 | ||
1597 | static void i7core_rdimm_check_mc_ecc_err(struct mem_ctl_info *mci) | 1590 | static void i7core_rdimm_check_mc_ecc_err(struct mem_ctl_info *mci) |
@@ -1710,7 +1703,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, | |||
1710 | const struct mce *m) | 1703 | const struct mce *m) |
1711 | { | 1704 | { |
1712 | struct i7core_pvt *pvt = mci->pvt_info; | 1705 | struct i7core_pvt *pvt = mci->pvt_info; |
1713 | char *type, *optype, *err, msg[80]; | 1706 | char *type, *optype, *err; |
1714 | enum hw_event_mc_err_type tp_event; | 1707 | enum hw_event_mc_err_type tp_event; |
1715 | unsigned long error = m->status & 0x1ff0000l; | 1708 | unsigned long error = m->status & 0x1ff0000l; |
1716 | bool uncorrected_error = m->mcgstatus & 1ll << 61; | 1709 | bool uncorrected_error = m->mcgstatus & 1ll << 61; |
@@ -1788,20 +1781,18 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, | |||
1788 | err = "unknown"; | 1781 | err = "unknown"; |
1789 | } | 1782 | } |
1790 | 1783 | ||
1791 | snprintf(msg, sizeof(msg), "count=%d %s", core_err_cnt, optype); | ||
1792 | |||
1793 | /* | 1784 | /* |
1794 | * Call the helper to output message | 1785 | * Call the helper to output message |
1795 | * FIXME: what to do if core_err_cnt > 1? Currently, it generates | 1786 | * FIXME: what to do if core_err_cnt > 1? Currently, it generates |
1796 | * only one event | 1787 | * only one event |
1797 | */ | 1788 | */ |
1798 | if (uncorrected_error || !pvt->is_registered) | 1789 | if (uncorrected_error || !pvt->is_registered) |
1799 | edac_mc_handle_error(tp_event, mci, 1, | 1790 | edac_mc_handle_error(tp_event, mci, core_err_cnt, |
1800 | m->addr >> PAGE_SHIFT, | 1791 | m->addr >> PAGE_SHIFT, |
1801 | m->addr & ~PAGE_MASK, | 1792 | m->addr & ~PAGE_MASK, |
1802 | syndrome, | 1793 | syndrome, |
1803 | channel, dimm, -1, | 1794 | channel, dimm, -1, |
1804 | err, msg); | 1795 | err, optype); |
1805 | } | 1796 | } |
1806 | 1797 | ||
1807 | /* | 1798 | /* |