Commit e17a2f42 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5926ff50
...@@ -1623,7 +1623,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, ...@@ -1623,7 +1623,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
const struct mce *m) const struct mce *m)
{ {
struct i7core_pvt *pvt = mci->pvt_info; struct i7core_pvt *pvt = mci->pvt_info;
char *type, *optype, *err, *msg; char *type, *optype, *err, msg[80];
enum hw_event_mc_err_type tp_event; enum hw_event_mc_err_type tp_event;
unsigned long error = m->status & 0x1ff0000l; unsigned long error = m->status & 0x1ff0000l;
bool uncorrected_error = m->mcgstatus & 1ll << 61; bool uncorrected_error = m->mcgstatus & 1ll << 61;
...@@ -1701,10 +1701,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, ...@@ -1701,10 +1701,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
err = "unknown"; err = "unknown";
} }
msg = kasprintf(GFP_ATOMIC, snprintf(msg, sizeof(msg), "count=%d %s", core_err_cnt, optype);
"addr=0x%08llx cpu=%d count=%d Err=%08llx:%08llx (%s: %s))\n",
(long long) m->addr, m->cpu, core_err_cnt,
(long long)m->status, (long long)m->misc, optype, err);
/* /*
* Call the helper to output message * Call the helper to output message
...@@ -1718,8 +1715,6 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, ...@@ -1718,8 +1715,6 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
syndrome, syndrome,
channel, dimm, -1, channel, dimm, -1,
err, msg, m); err, msg, m);
kfree(msg);
} }
/* /*
......
...@@ -788,7 +788,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, ...@@ -788,7 +788,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
u8 *socket, u8 *socket,
long *channel_mask, long *channel_mask,
u8 *rank, u8 *rank,
char *area_type, char *msg) char **area_type, char *msg)
{ {
struct mem_ctl_info *new_mci; struct mem_ctl_info *new_mci;
struct sbridge_pvt *pvt = mci->pvt_info; struct sbridge_pvt *pvt = mci->pvt_info;
...@@ -843,7 +843,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, ...@@ -843,7 +843,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
sprintf(msg, "Can't discover the memory socket"); sprintf(msg, "Can't discover the memory socket");
return -EINVAL; return -EINVAL;
} }
area_type = get_dram_attr(reg); *area_type = get_dram_attr(reg);
interleave_mode = INTERLEAVE_MODE(reg); interleave_mode = INTERLEAVE_MODE(reg);
pci_read_config_dword(pvt->pci_sad0, interleave_list[n_sads], 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,7 +1342,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
struct mem_ctl_info *new_mci; struct mem_ctl_info *new_mci;
struct sbridge_pvt *pvt = mci->pvt_info; struct sbridge_pvt *pvt = mci->pvt_info;
enum hw_event_mc_err_type tp_event; enum hw_event_mc_err_type tp_event;
char *type, *optype, msg[256], *recoverable_msg; char *type, *optype, msg[256];
bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0); bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0);
bool overflow = GET_BITFIELD(m->status, 62, 62); bool overflow = GET_BITFIELD(m->status, 62, 62);
bool uncorrected_error = GET_BITFIELD(m->status, 61, 61); 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,7 +1355,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
long channel_mask, first_channel; long channel_mask, first_channel;
u8 rank, socket; u8 rank, socket;
int rc, dimm; int rc, dimm;
char *area_type = "Unknown"; char *area_type = NULL;
if (uncorrected_error) { if (uncorrected_error) {
if (ripv) { if (ripv) {
...@@ -1407,7 +1407,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci, ...@@ -1407,7 +1407,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
} }
rc = get_memory_error_data(mci, m->addr, &socket, rc = get_memory_error_data(mci, m->addr, &socket,
&channel_mask, &rank, area_type, msg); &channel_mask, &rank, &area_type, msg);
if (rc < 0) if (rc < 0)
goto err_parsing; goto err_parsing;
new_mci = get_mci_for_node_id(socket); new_mci = get_mci_for_node_id(socket);
...@@ -1427,29 +1427,23 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci, ...@@ -1427,29 +1427,23 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
else else
dimm = 2; dimm = 2;
if (uncorrected_error && recoverable)
recoverable_msg = " recoverable";
else
recoverable_msg = "";
/* /*
* FIXME: What should we do with "channel" information on mcelog? * FIXME: On some memory configurations (mirror, lockstep), the
* Probably, we can just discard it, as the channel information * Memory Controller can't point the error to a single DIMM. The
* comes from the get_memory_error_data() address decoding * EDAC core should be handling the channel mask, in order to point
* to the group of dimm's where the error may be happening.
*/ */
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"%d error(s)%s: %s%s: cpu=%d Err=%04x:%04x addr = 0x%08llx socket=%d Channel=%ld(mask=%ld), rank=%d\n", "count:%d%s%s area:%s err_code:%04x:%04x socket:%d channel_mask:%ld rank:%d",
core_err_cnt, core_err_cnt,
overflow ? " OVERFLOW" : "", overflow ? " OVERFLOW" : "",
area_type, (uncorrected_error && recoverable) ? " recoverable" : "",
recoverable_msg, area_type,
m->cpu, mscod, errcode,
mscod, errcode, socket,
(long long) m->addr, channel_mask,
socket, rank);
first_channel, /* This is the real channel on SB */
channel_mask,
rank);
debugf0("%s", msg); debugf0("%s", msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment