]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: fix PCIe AER error type
authorThomas Tai <thomas.tai@oracle.com>
Mon, 14 May 2018 14:33:47 +0000 (10:33 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 14 Aug 2018 15:45:17 +0000 (12:45 -0300)
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.

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
ras-aer-handler.c
ras-events.h

index 209387533035c17428f77418ce08b6d57f936c46..65e321df234a993bd4f633f977bacdbc98c1df70 100644 (file)
@@ -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);
 
index e7734b215e09e8f59d151227e9dea3d7a88f15f6..1a783909773b8941ed8863417bfde827304f3ad4 100644 (file)
@@ -68,6 +68,13 @@ enum hw_event_mc_err_type {
        HW_EVENT_ERR_INFO,
 };
 
+/* 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,