aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-05-11 10:41:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-28 18:13:51 -0400
commite17a2f42a484562be48128c5b8dc9f7291e8c902 (patch)
tree67d92491b66625b20be6fcb03a39c18424adbe7e /drivers/edac
parent5926ff502f6b93ca0c1654f8a5c5317ea236dbdb (diff)
edac: Cleanup the logs for i7core and sb edac drivers
Remove some information that it is duplicated at the MCE log, and don't have much usage for the error. Those data will be added again, when creating a trace function that outputs both memory errors and MCE fields. Cc: Aristeu Rozanski <arozansk@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7core_edac.c9
-rw-r--r--drivers/edac/sb_edac.c42
2 files changed, 20 insertions, 31 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 6d89c78a9b7a..2aacd951d41c 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1623,7 +1623,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
1623 const struct mce *m) 1623 const struct mce *m)
1624{ 1624{
1625 struct i7core_pvt *pvt = mci->pvt_info; 1625 struct i7core_pvt *pvt = mci->pvt_info;
1626 char *type, *optype, *err, *msg; 1626 char *type, *optype, *err, msg[80];
1627 enum hw_event_mc_err_type tp_event; 1627 enum hw_event_mc_err_type tp_event;
1628 unsigned long error = m->status & 0x1ff0000l; 1628 unsigned long error = m->status & 0x1ff0000l;
1629 bool uncorrected_error = m->mcgstatus & 1ll << 61; 1629 bool uncorrected_error = m->mcgstatus & 1ll << 61;
@@ -1701,10 +1701,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
1701 err = "unknown"; 1701 err = "unknown";
1702 } 1702 }
1703 1703
1704 msg = kasprintf(GFP_ATOMIC, 1704 snprintf(msg, sizeof(msg), "count=%d %s", core_err_cnt, optype);
1705 "addr=0x%08llx cpu=%d count=%d Err=%08llx:%08llx (%s: %s))\n",
1706 (long long) m->addr, m->cpu, core_err_cnt,
1707 (long long)m->status, (long long)m->misc, optype, err);
1708 1705
1709 /* 1706 /*
1710 * Call the helper to output message 1707 * Call the helper to output message
@@ -1718,8 +1715,6 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
1718 syndrome, 1715 syndrome,
1719 channel, dimm, -1, 1716 channel, dimm, -1,
1720 err, msg, m); 1717 err, msg, m);
1721
1722 kfree(msg);
1723} 1718}
1724 1719
1725/* 1720/*
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 2f95a1b583dc..e834dfd034d6 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -788,7 +788,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
788 u8 *socket, 788 u8 *socket,
789 long *channel_mask, 789 long *channel_mask,
790 u8 *rank, 790 u8 *rank,
791 char *area_type, char *msg) 791 char **area_type, char *msg)
792{ 792{
793 struct mem_ctl_info *new_mci; 793 struct mem_ctl_info *new_mci;
794 struct sbridge_pvt *pvt = mci->pvt_info; 794 struct sbridge_pvt *pvt = mci->pvt_info;
@@ -843,7 +843,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
843 sprintf(msg, "Can't discover the memory socket"); 843 sprintf(msg, "Can't discover the memory socket");
844 return -EINVAL; 844 return -EINVAL;
845 } 845 }
846 area_type = get_dram_attr(reg); 846 *area_type = get_dram_attr(reg);
847 interleave_mode = INTERLEAVE_MODE(reg); 847 interleave_mode = INTERLEAVE_MODE(reg);
848 848
849 pci_read_config_dword(pvt->pci_sad0, interleave_list[n_sads], 849 pci_read_config_dword(pvt->pci_sad0, interleave_list[n_sads],
@@ -1342,7 +1342,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
1342 struct mem_ctl_info *new_mci; 1342 struct mem_ctl_info *new_mci;
1343 struct sbridge_pvt *pvt = mci->pvt_info; 1343 struct sbridge_pvt *pvt = mci->pvt_info;
1344 enum hw_event_mc_err_type tp_event; 1344 enum hw_event_mc_err_type tp_event;
1345 char *type, *optype, msg[256], *recoverable_msg; 1345 char *type, *optype, msg[256];
1346 bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0); 1346 bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0);
1347 bool overflow = GET_BITFIELD(m->status, 62, 62); 1347 bool overflow = GET_BITFIELD(m->status, 62, 62);
1348 bool uncorrected_error = GET_BITFIELD(m->status, 61, 61); 1348 bool uncorrected_error = GET_BITFIELD(m->status, 61, 61);
@@ -1355,7 +1355,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
1355 long channel_mask, first_channel; 1355 long channel_mask, first_channel;
1356 u8 rank, socket; 1356 u8 rank, socket;
1357 int rc, dimm; 1357 int rc, dimm;
1358 char *area_type = "Unknown"; 1358 char *area_type = NULL;
1359 1359
1360 if (uncorrected_error) { 1360 if (uncorrected_error) {
1361 if (ripv) { 1361 if (ripv) {
@@ -1407,7 +1407,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
1407 } 1407 }
1408 1408
1409 rc = get_memory_error_data(mci, m->addr, &socket, 1409 rc = get_memory_error_data(mci, m->addr, &socket,
1410 &channel_mask, &rank, area_type, msg); 1410 &channel_mask, &rank, &area_type, msg);
1411 if (rc < 0) 1411 if (rc < 0)
1412 goto err_parsing; 1412 goto err_parsing;
1413 new_mci = get_mci_for_node_id(socket); 1413 new_mci = get_mci_for_node_id(socket);
@@ -1427,29 +1427,23 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
1427 else 1427 else
1428 dimm = 2; 1428 dimm = 2;
1429 1429
1430 if (uncorrected_error && recoverable)
1431 recoverable_msg = " recoverable";
1432 else
1433 recoverable_msg = "";
1434 1430
1435 /* 1431 /*
1436 * FIXME: What should we do with "channel" information on mcelog? 1432 * FIXME: On some memory configurations (mirror, lockstep), the
1437 * Probably, we can just discard it, as the channel information 1433 * Memory Controller can't point the error to a single DIMM. The
1438 * comes from the get_memory_error_data() address decoding 1434 * EDAC core should be handling the channel mask, in order to point
1435 * to the group of dimm's where the error may be happening.
1439 */ 1436 */
1440 snprintf(msg, sizeof(msg), 1437 snprintf(msg, sizeof(msg),
1441 "%d error(s)%s: %s%s: cpu=%d Err=%04x:%04x addr = 0x%08llx socket=%d Channel=%ld(mask=%ld), rank=%d\n", 1438 "count:%d%s%s area:%s err_code:%04x:%04x socket:%d channel_mask:%ld rank:%d",
1442 core_err_cnt, 1439 core_err_cnt,
1443 overflow ? " OVERFLOW" : "", 1440 overflow ? " OVERFLOW" : "",
1444 area_type, 1441 (uncorrected_error && recoverable) ? " recoverable" : "",
1445 recoverable_msg, 1442 area_type,
1446 m->cpu, 1443 mscod, errcode,
1447 mscod, errcode, 1444 socket,
1448 (long long) m->addr, 1445 channel_mask,
1449 socket, 1446 rank);
1450 first_channel, /* This is the real channel on SB */
1451 channel_mask,
1452 rank);
1453 1447
1454 debugf0("%s", msg); 1448 debugf0("%s", msg);
1455 1449