From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
Linux Edac Mailing List <linux-edac@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH EDACv2 12/12] ghes_edac: Fix RAS tracing
Date: Thu, 21 Feb 2013 12:39:10 -0300 [thread overview]
Message-ID: <ca154bf4bb0ee52ef1d43baa576c640620e12492.1361459782.git.mchehab@redhat.com> (raw)
In-Reply-To: <cover.1361459782.git.mchehab@redhat.com>
With the current version of CPER, there's no way to associate an
error with the memory error. So, the error location in EDAC
layers is unused.
As CPER has its own idea about memory architectural layers, just
output whatever is there inside the driver's detail at the RAS
tracepoint.
The EDAC location keeps untouched, in the case that, in some future,
we could actually map the error into the dimm labels.
Now, the error message:
[ 72.396625] {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 0
[ 72.396627] {1}[Hardware Error]: APEI generic hardware error status
[ 72.396628] {1}[Hardware Error]: severity: 2, corrected
[ 72.396630] {1}[Hardware Error]: section: 0, severity: 2, corrected
[ 72.396632] {1}[Hardware Error]: flags: 0x01
[ 72.396634] {1}[Hardware Error]: primary
[ 72.396635] {1}[Hardware Error]: section_type: memory error
[ 72.396637] {1}[Hardware Error]: error_status: 0x0000000000000400
[ 72.396638] {1}[Hardware Error]: node: 3
[ 72.396639] {1}[Hardware Error]: card: 0
[ 72.396640] {1}[Hardware Error]: module: 0
[ 72.396641] {1}[Hardware Error]: device: 0
[ 72.396643] {1}[Hardware Error]: error_type: 18, unknown
[ 72.396666] EDAC MC0: 1 CE reserved error (18) on unknown label (node:3 card:0 module:0 page:0x0 offset:0x0 grain:0 syndrome:0x0 - status(0x0000000000000400): Storage error in DRAM memory)
Is properly represented on the trace event:
kworker/0:2-584 [000] .... 72.396657: mc_event: 1 Corrected error: reserved error (18) on unknown label (mc:0 location:-1:-1:-1 address:0x00000000 grain:1 syndrome:0x00000000 APEI location: node:3 card:0 module:0 status(0x0000000000000400): Storage error in DRAM memory)
Tested on a 4 sockets E5-4650 Sandy Bridge machine.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/edac/edac_mc.c | 16 ++++++++--------
drivers/edac/ghes_edac.c | 13 +++++++++++++
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 501061d..cdb81aa 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -1082,16 +1082,8 @@ void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type,
struct edac_raw_error_desc *e)
{
char detail[80];
- u8 grain_bits;
int pos[EDAC_MAX_LAYERS] = { e->top_layer, e->mid_layer, e->low_layer };
- /* Report the error via the trace interface */
- grain_bits = fls_long(e->grain) + 1;
- trace_mc_event(type, e->msg, e->label, e->error_count,
- mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer,
- PAGES_TO_MiB(e->page_frame_number) | e->offset_in_page,
- grain_bits, e->syndrome, e->other_detail);
-
/* Memory type dependent details about the error */
if (type == HW_EVENT_ERR_CORRECTED) {
snprintf(detail, sizeof(detail),
@@ -1148,6 +1140,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
int row = -1, chan = -1;
int pos[EDAC_MAX_LAYERS] = { top_layer, mid_layer, low_layer };
int i, n_labels = 0;
+ u8 grain_bits;
struct edac_raw_error_desc *e = &mci->error_desc;
edac_dbg(3, "MC%d\n", mci->mc_idx);
@@ -1287,6 +1280,13 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
if (p > e->location)
*(p - 1) = '\0';
+ /* Report the error via the trace interface */
+ grain_bits = fls_long(e->grain) + 1;
+ trace_mc_event(type, e->msg, e->label, e->error_count,
+ mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer,
+ PAGES_TO_MiB(e->page_frame_number) | e->offset_in_page,
+ grain_bits, e->syndrome, e->other_detail);
+
edac_raw_mc_handle_error(type, mci, e);
}
EXPORT_SYMBOL_GPL(edac_mc_handle_error);
diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index 1bde451..636dcf1 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -15,6 +15,7 @@
#include <linux/edac.h>
#include <linux/dmi.h>
#include "edac_core.h"
+#include <ras/ras_event.h>
#define GHES_EDAC_REVISION " Ver: 1.0.0"
@@ -24,6 +25,7 @@ struct ghes_edac_pvt {
struct mem_ctl_info *mci;
/* Buffers for the error handling routine */
+ char detail_location[240];
char other_detail[160];
char msg[80];
};
@@ -191,6 +193,7 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
struct mem_ctl_info *mci;
struct ghes_edac_pvt *pvt = NULL;
char *p;
+ u8 grain_bits;
list_for_each_entry(pvt, &ghes_reglist, list) {
if (ghes == pvt->ghes)
@@ -398,6 +401,16 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
if (p > pvt->other_detail)
*(p - 1) = '\0';
+ /* Generate the trace event */
+ grain_bits = fls_long(e->grain);
+ sprintf(pvt->detail_location, "APEI location: %s %s",
+ e->location, e->other_detail);
+ trace_mc_event(type, e->msg, e->label, e->error_count,
+ mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer,
+ PAGES_TO_MiB(e->page_frame_number) | e->offset_in_page,
+ grain_bits, e->syndrome, pvt->detail_location);
+
+ /* Report the error via EDAC API */
edac_raw_mc_handle_error(type, mci, e);
}
EXPORT_SYMBOL_GPL(ghes_edac_report_mem_error);
--
1.8.1.2
prev parent reply other threads:[~2013-02-21 15:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 15:38 [PATCH EDACv2 00/12] Add a driver to report Firmware first errors (via GHES) Mauro Carvalho Chehab
2013-02-21 15:38 ` [PATCH EDACv2 01/12] edac: add support for raw error reports Mauro Carvalho Chehab
2013-02-21 15:53 ` Borislav Petkov
2013-02-21 16:01 ` Mauro Carvalho Chehab
2013-02-21 16:08 ` Borislav Petkov
2013-02-21 17:47 ` Mauro Carvalho Chehab
2013-02-21 18:03 ` Borislav Petkov
2013-02-21 15:39 ` [PATCH EDACv2 02/12] edac: add support for error type "Info" Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 03/12] ghes: move structures/enum to a header file Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 04/12] ghes: add the needed hooks for EDAC error report Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 05/12] ghes_edac: Register at EDAC core the BIOS report Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 06/12] ghes_edac: add support for reporting errors via EDAC Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 07/12] ghes_edac: do a better job of filling EDAC DIMM info Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 08/12] ghes_edac: Don't credit the same memory dimm twice Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 09/12] ghes_edac: Improve driver's printk messages Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 10/12] edac: put all arguments for the raw error handling call into a struct Mauro Carvalho Chehab
2013-02-21 15:39 ` [PATCH EDACv2 11/12] ghes_edac: Make it compliant with UEFI spec 2.3.1 Mauro Carvalho Chehab
2013-02-21 15:39 ` Mauro Carvalho Chehab [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca154bf4bb0ee52ef1d43baa576c640620e12492.1361459782.git.mchehab@redhat.com \
--to=mchehab@redhat.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®