Skip to contentSkip to conversation

rasdaemon: fix PCIe AER error type

PATCH New Mauro Carvalho Chehab 1 participant 1 message Aug 14, 2018 EDAC-core

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rasdaemon: fix PCIe AER error type

Em Mon, 14 May 2018 10:33:47 -0400
Thomas Tai <[email protected]> escreveu:

Quoted 4 lines

The error types between PCIe AER and CPU Machine Check are different. when handling aer_event, the PCIe AER error type should be used. Add an enum to match the kernel PCIe AER and use it to decode the error type.

Both patches applied, thanks!

Quoted 45 lines
---
 ras-aer-handler.c | 15 +++++++--------
 ras-events.h      |  7 +++++++
 2 files changed, 14 insertions(+), 8 deletions(-)
ras-aer-handler.c +7 -8
index 2093875..65e321d 100644
@@ -96,18 +96,17 @@ int ras_aer_event_handler(struct trace_seq *s,
 	if (pevent_get_field_val(s, event, "severity", record, &val, 1) < 0)
 		return -1;
 	switch (val) {
-	case HW_EVENT_ERR_CORRECTED:
-		ev.error_type = "Corrected";
+	case HW_EVENT_AER_UNCORRECTED_NON_FATAL:
+		ev.error_type = "Uncorrected (Non-Fatal)";
 		break;
-	case HW_EVENT_ERR_UNCORRECTED:
-		ev.error_type = "Uncorrected";
+        case HW_EVENT_AER_UNCORRECTED_FATAL:
+		ev.error_type = "Uncorrected (Fatal)";
 		break;
-	case HW_EVENT_ERR_FATAL:
-		ev.error_type = "Fatal";
+        case HW_EVENT_AER_CORRECTED:
+		ev.error_type = "Corrected";
 		break;
 	default:
-	case HW_EVENT_ERR_INFO:
-		ev.error_type = "Info";
+		ev.error_type = "Unknown severity";
 	}
 	trace_seq_puts(s, ev.error_type);
 
ras-events.h +0 -0
index e7734b2..1a78390 100644
@@ -68,6 +68,13 @@ enum hw_event_mc_err_type {
 	HW_EVENT_ERR_INFO,
 };
 

ras-events.h enum hw_event_mc_err_type { · line 80

Quoted 10 lines
ras-events.h +7 -0
+/* Should match the code at Kernel's /drivers/pci/pcie/aer/aerdrv_errprint.c */
+enum hw_event_aer_err_type {
+	HW_EVENT_AER_UNCORRECTED_NON_FATAL,
+	HW_EVENT_AER_UNCORRECTED_FATAL,
+	HW_EVENT_AER_CORRECTED,
+};
+
 /* Should match the code at Kernel's include/acpi/ghes.h */
 enum ghes_severity {
 	GHES_SEV_NO,

Thanks,
Mauro