aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/ghes_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/ghes_edac.c')
-rw-r--r--drivers/edac/ghes_edac.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index 1bde45141073..636dcf18d5b6 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -15,6 +15,7 @@
15#include <linux/edac.h> 15#include <linux/edac.h>
16#include <linux/dmi.h> 16#include <linux/dmi.h>
17#include "edac_core.h" 17#include "edac_core.h"
18#include <ras/ras_event.h>
18 19
19#define GHES_EDAC_REVISION " Ver: 1.0.0" 20#define GHES_EDAC_REVISION " Ver: 1.0.0"
20 21
@@ -24,6 +25,7 @@ struct ghes_edac_pvt {
24 struct mem_ctl_info *mci; 25 struct mem_ctl_info *mci;
25 26
26 /* Buffers for the error handling routine */ 27 /* Buffers for the error handling routine */
28 char detail_location[240];
27 char other_detail[160]; 29 char other_detail[160];
28 char msg[80]; 30 char msg[80];
29}; 31};
@@ -191,6 +193,7 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
191 struct mem_ctl_info *mci; 193 struct mem_ctl_info *mci;
192 struct ghes_edac_pvt *pvt = NULL; 194 struct ghes_edac_pvt *pvt = NULL;
193 char *p; 195 char *p;
196 u8 grain_bits;
194 197
195 list_for_each_entry(pvt, &ghes_reglist, list) { 198 list_for_each_entry(pvt, &ghes_reglist, list) {
196 if (ghes == pvt->ghes) 199 if (ghes == pvt->ghes)
@@ -398,6 +401,16 @@ void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
398 if (p > pvt->other_detail) 401 if (p > pvt->other_detail)
399 *(p - 1) = '\0'; 402 *(p - 1) = '\0';
400 403
404 /* Generate the trace event */
405 grain_bits = fls_long(e->grain);
406 sprintf(pvt->detail_location, "APEI location: %s %s",
407 e->location, e->other_detail);
408 trace_mc_event(type, e->msg, e->label, e->error_count,
409 mci->mc_idx, e->top_layer, e->mid_layer, e->low_layer,
410 PAGES_TO_MiB(e->page_frame_number) | e->offset_in_page,
411 grain_bits, e->syndrome, pvt->detail_location);
412
413 /* Report the error via EDAC API */
401 edac_raw_mc_handle_error(type, mci, e); 414 edac_raw_mc_handle_error(type, mci, e);
402} 415}
403EXPORT_SYMBOL_GPL(ghes_edac_report_mem_error); 416EXPORT_SYMBOL_GPL(ghes_edac_report_mem_error);