Introduce a new helper function cper_mem_err_status_str() to decode the error status value into a human readable string. [ bp: Massage. ]
Unified · Split
| @@ -211,6 +211,32 @@ const char *cper_mem_err_type_str(unsigned int etype) · 210 unmodified lines | ||
| 211 | 211 | } |
| 212 | 212 | EXPORT_SYMBOL_GPL(cper_mem_err_type_str); |
| 213 | 213 | |
| 214 | +const char *cper_mem_err_status_str(u64 status) | |
| 215 | +{ | |
| 216 | + switch ((status >> 8) & 0xff) { | |
| 217 | + case 1: return "Error detected internal to the component"; | |
| 218 | + case 4: return "Storage error in DRAM memory"; | |
| 219 | + case 5: return "Storage error in TLB"; | |
| 220 | + case 6: return "Storage error in cache"; | |
| 221 | + case 7: return "Error in one or more functional units"; | |
| 222 | + case 8: return "Component failed self test"; | |
| 223 | + case 9: return "Overflow or undervalue of internal queue"; | |
| 224 | + case 16: return "Error detected in the bus"; | |
| 225 | + case 17: return "Virtual address not found on IO-TLB or IO-PDIR"; | |
| 226 | + case 18: return "Improper access error"; | |
| 227 | + case 19: return "Access to a memory address which is not mapped to any component"; | |
| 228 | + case 20: return "Loss of Lockstep"; | |
| 229 | + case 21: return "Response not associated with a request"; | |
| 230 | + case 22: return "Bus parity error - must also set the A, C, or D Bits"; | |
| 231 | + case 23: return "Detection of a protocol error"; | |
| 232 | + case 24: return "Detection of a PATH_ERROR"; | |
| 233 | + case 25: return "Bus operation timeout"; | |
| 234 | + case 26: return "A read was issued to data that has been poisoned"; | |
| 235 | + default: return "Reserved"; | |
| 236 | + } | |
| 237 | +} | |
| 238 | +EXPORT_SYMBOL_GPL(cper_mem_err_status_str); | |
| 239 | + | |
| 214 | 240 | static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg) |
| 215 | 241 | { |
| 216 | 242 | u32 len, n; |
| @@ -334,7 +360,9 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem, · 117 unmodified lines | ||
| 334 | 360 | return; |
| 335 | 361 | } |
| 336 | 362 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) |
| 337 | − printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); | |
| 363 | + printk("%s error_status: %s (0x%016llx)\n", | |
| 364 | + pfx, cper_mem_err_status_str(mem->error_status), | |
| 365 | + mem->error_status); | |
| 338 | 366 | if (mem->validation_bits & CPER_MEM_VALID_PA) |
| 339 | 367 | printk("%s""physical_address: 0x%016llx\n", |
| 340 | 368 | pfx, mem->physical_addr); |
| @@ -558,6 +558,7 @@ extern const char *const cper_proc_error_type_strs[4]; · 557 unmodified lines | ||
| 558 | 558 | u64 cper_next_record_id(void); |
| 559 | 559 | const char *cper_severity_str(unsigned int); |
| 560 | 560 | const char *cper_mem_err_type_str(unsigned int); |
| 561 | +const char *cper_mem_err_status_str(u64 status); | |
| 561 | 562 | void cper_print_bits(const char *prefix, unsigned int bits, |
| 562 | 563 | const char * const strs[], unsigned int strs_size); |
| 563 | 564 | void cper_mem_err_pack(const struct cper_sec_mem_err *, |