diff options
author | Chen, Gong <gong.chen@linux.intel.com> | 2014-06-17 22:33:07 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2014-06-25 16:26:47 -0400 |
commit | 2dfb7d51a61d7ca91b131c8db612f27d9390f2d5 (patch) | |
tree | b2e9375f1ffaf2dc93418d78c27b6a13b34c8e88 /drivers/firmware/efi | |
parent | d963cd95bea93b7db9390a71d1e2cabbb3b2c3ea (diff) |
trace, RAS: Add eMCA trace event interface
Add trace interface to elaborate all H/W error related information.
Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r-- | drivers/firmware/efi/cper.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index ac33a9fed341..437e6fd47311 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c | |||
@@ -207,7 +207,7 @@ const char *cper_mem_err_type_str(unsigned int etype) | |||
207 | } | 207 | } |
208 | EXPORT_SYMBOL_GPL(cper_mem_err_type_str); | 208 | EXPORT_SYMBOL_GPL(cper_mem_err_type_str); |
209 | 209 | ||
210 | static int cper_mem_err_location(const struct cper_sec_mem_err *mem, char *msg) | 210 | static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg) |
211 | { | 211 | { |
212 | u32 len, n; | 212 | u32 len, n; |
213 | 213 | ||
@@ -249,7 +249,7 @@ static int cper_mem_err_location(const struct cper_sec_mem_err *mem, char *msg) | |||
249 | return n; | 249 | return n; |
250 | } | 250 | } |
251 | 251 | ||
252 | static int cper_dimm_err_location(const struct cper_sec_mem_err *mem, char *msg) | 252 | static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg) |
253 | { | 253 | { |
254 | u32 len, n; | 254 | u32 len, n; |
255 | const char *bank = NULL, *device = NULL; | 255 | const char *bank = NULL, *device = NULL; |
@@ -271,8 +271,44 @@ static int cper_dimm_err_location(const struct cper_sec_mem_err *mem, char *msg) | |||
271 | return n; | 271 | return n; |
272 | } | 272 | } |
273 | 273 | ||
274 | void cper_mem_err_pack(const struct cper_sec_mem_err *mem, | ||
275 | struct cper_mem_err_compact *cmem) | ||
276 | { | ||
277 | cmem->validation_bits = mem->validation_bits; | ||
278 | cmem->node = mem->node; | ||
279 | cmem->card = mem->card; | ||
280 | cmem->module = mem->module; | ||
281 | cmem->bank = mem->bank; | ||
282 | cmem->device = mem->device; | ||
283 | cmem->row = mem->row; | ||
284 | cmem->column = mem->column; | ||
285 | cmem->bit_pos = mem->bit_pos; | ||
286 | cmem->requestor_id = mem->requestor_id; | ||
287 | cmem->responder_id = mem->responder_id; | ||
288 | cmem->target_id = mem->target_id; | ||
289 | cmem->rank = mem->rank; | ||
290 | cmem->mem_array_handle = mem->mem_array_handle; | ||
291 | cmem->mem_dev_handle = mem->mem_dev_handle; | ||
292 | } | ||
293 | |||
294 | const char *cper_mem_err_unpack(struct trace_seq *p, | ||
295 | struct cper_mem_err_compact *cmem) | ||
296 | { | ||
297 | const char *ret = p->buffer + p->len; | ||
298 | |||
299 | if (cper_mem_err_location(cmem, rcd_decode_str)) | ||
300 | trace_seq_printf(p, "%s", rcd_decode_str); | ||
301 | if (cper_dimm_err_location(cmem, rcd_decode_str)) | ||
302 | trace_seq_printf(p, "%s", rcd_decode_str); | ||
303 | trace_seq_putc(p, '\0'); | ||
304 | |||
305 | return ret; | ||
306 | } | ||
307 | |||
274 | static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem) | 308 | static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem) |
275 | { | 309 | { |
310 | struct cper_mem_err_compact cmem; | ||
311 | |||
276 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) | 312 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) |
277 | printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); | 313 | printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); |
278 | if (mem->validation_bits & CPER_MEM_VALID_PA) | 314 | if (mem->validation_bits & CPER_MEM_VALID_PA) |
@@ -281,14 +317,15 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem) | |||
281 | if (mem->validation_bits & CPER_MEM_VALID_PA_MASK) | 317 | if (mem->validation_bits & CPER_MEM_VALID_PA_MASK) |
282 | printk("%s""physical_address_mask: 0x%016llx\n", | 318 | printk("%s""physical_address_mask: 0x%016llx\n", |
283 | pfx, mem->physical_addr_mask); | 319 | pfx, mem->physical_addr_mask); |
284 | if (cper_mem_err_location(mem, rcd_decode_str)) | 320 | cper_mem_err_pack(mem, &cmem); |
321 | if (cper_mem_err_location(&cmem, rcd_decode_str)) | ||
285 | printk("%s%s\n", pfx, rcd_decode_str); | 322 | printk("%s%s\n", pfx, rcd_decode_str); |
286 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_TYPE) { | 323 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_TYPE) { |
287 | u8 etype = mem->error_type; | 324 | u8 etype = mem->error_type; |
288 | printk("%s""error_type: %d, %s\n", pfx, etype, | 325 | printk("%s""error_type: %d, %s\n", pfx, etype, |
289 | cper_mem_err_type_str(etype)); | 326 | cper_mem_err_type_str(etype)); |
290 | } | 327 | } |
291 | if (cper_dimm_err_location(mem, rcd_decode_str)) | 328 | if (cper_dimm_err_location(&cmem, rcd_decode_str)) |
292 | printk("%s%s\n", pfx, rcd_decode_str); | 329 | printk("%s%s\n", pfx, rcd_decode_str); |
293 | } | 330 | } |
294 | 331 | ||