summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-03-18 09:55:21 +0100
committerBorislav Petkov <bp@suse.de>2015-04-27 21:23:44 +0200
commit6169ddf846c528509e66a0fe7804393aa330a970 (patch)
tree556da0447bcdaf54ff21b2ee3bde1371f32e7cfa /drivers/acpi/apei
parente10be03f603d521d5c8ac0bb0f48e5723ce19d58 (diff)
downloadlinux-6169ddf846c528509e66a0fe7804393aa330a970.tar.bz2
GHES: Panic right after detection
The moment we log an error of panic severity, there's no need to noodle through the ghes_nmi list anymore. So panic instead right then and there. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 712ed95b1dca..0de3adcca03e 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -837,9 +837,8 @@ static void __ghes_panic(struct ghes *ghes)
static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
{
- struct ghes *ghes, *ghes_global = NULL;
- int sev, sev_global = -1;
- int ret = NMI_DONE;
+ struct ghes *ghes;
+ int sev, ret = NMI_DONE;
raw_spin_lock(&ghes_nmi_lock);
list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
@@ -847,20 +846,17 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
ghes_clear_estatus(ghes);
continue;
}
+
sev = ghes_severity(ghes->estatus->error_severity);
- if (sev > sev_global) {
- sev_global = sev;
- ghes_global = ghes;
- }
+ if (sev >= GHES_SEV_PANIC)
+ __ghes_panic(ghes);
+
ret = NMI_HANDLED;
}
if (ret == NMI_DONE)
goto out;
- if (sev_global >= GHES_SEV_PANIC)
- __ghes_panic(ghes_global);
-
list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
if (!(ghes->flags & GHES_TO_CLEAR))
continue;