Message ID | 1386267670.18256.8.camel@ejdallLaptop (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On Thu, Dec 05, 2013 at 11:21:10AM -0700, Betty Dall wrote: > The definition of the GHES_SEV* matches up with the error severity > definition of the CPER records as defined in the UEFI spec section > N.2.1: > "Indicates the severity of the error condition. The severity of > the error record corresponds to the most severe error > section. > 0 - Recoverable (also called non-fatal uncorrected) > 1 - Fatal > 2 - Corrected > 3 - Informational > All other values are reserved. > Note that severity of "Informational" indicates that the record > could be safely ignored by error handling software." Actually, we can go even one radical step further and drop ghes_severity() completely because GHES severity in the ACPI spec 5.0 is defined almost exactly the same: "18.3.2.6.1 Generic Error Data ... Identifies the error severity of the reported error: 0 – Recoverable? 1 – Fatal? 2 – Corrected? 3 – None Note: This is the error severity of the entire event. Each Generic Error Data Entry also includes its own Error Severity field." I don't know which version of the spec dictated enum { GHES_SEV_NO = 0x0, GHES_SEV_CORRECTED = 0x1, GHES_SEV_RECOVERABLE = 0x2, GHES_SEV_PANIC = 0x3, }; though and whether we're going to have to differentiate between the old and GHES numerical severity levels. Which, if we have to, would be very nasty...
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index a30bc31..c59144e 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -301,16 +301,18 @@ static inline int ghes_severity(int severity) { switch (severity) { case CPER_SEV_INFORMATIONAL: - return GHES_SEV_NO; + return GHES_SEV_NONE; case CPER_SEV_CORRECTED: return GHES_SEV_CORRECTED; case CPER_SEV_RECOVERABLE: return GHES_SEV_RECOVERABLE; case CPER_SEV_FATAL: - return GHES_SEV_PANIC; + return GHES_SEV_FATAL; default: /* Unknown, go panic */ - return GHES_SEV_PANIC; + pr_warn(FW_WARN GHES_PFX + "Invalid CPER severity: %d\n", severity); + return GHES_SEV_FATAL; } } @@ -828,7 +830,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) if (ret == NMI_DONE) goto out; - if (sev_global >= GHES_SEV_PANIC) { + if (sev_global >= GHES_SEV_FATAL) { oops_begin(); ghes_print_queued_estatus(); __ghes_print_estatus(KERN_EMERG, ghes_global->generic, diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index dfd60d0..7cefa89 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -39,10 +39,10 @@ struct ghes_estatus_cache { }; enum { - GHES_SEV_NO = 0x0, - GHES_SEV_CORRECTED = 0x1, - GHES_SEV_RECOVERABLE = 0x2, - GHES_SEV_PANIC = 0x3, + GHES_SEV_RECOVERABLE = 0x0, + GHES_SEV_FATAL = 0x1, + GHES_SEV_CORRECTED = 0x2, + GHES_SEV_NONE = 0x3, }; /* From drivers/edac/ghes_edac.c */