summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-03-18 05:12:35 -0400
committerBorislav Petkov <bp@suse.de>2015-04-27 15:27:35 -0400
commit2383844d4850888cfdf6d202563d2ddb4125a4e9 (patch)
tree279614f1102aee6e753be680b83dbf25ae032348 /drivers/acpi/apei
parent6169ddf846c528509e66a0fe7804393aa330a970 (diff)
GHES: Elliminate double-loop in the NMI handler
There's no real need to iterate twice over the HW error sources in the NMI handler. With the previous cleanups, elliminating the second loop is almost trivial. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 0de3adcca03e..94a44bad5576 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -851,25 +851,18 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
851 if (sev >= GHES_SEV_PANIC) 851 if (sev >= GHES_SEV_PANIC)
852 __ghes_panic(ghes); 852 __ghes_panic(ghes);
853 853
854 ret = NMI_HANDLED;
855 }
856
857 if (ret == NMI_DONE)
858 goto out;
859
860 list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
861 if (!(ghes->flags & GHES_TO_CLEAR)) 854 if (!(ghes->flags & GHES_TO_CLEAR))
862 continue; 855 continue;
863 856
864 __process_error(ghes); 857 __process_error(ghes);
865 ghes_clear_estatus(ghes); 858 ghes_clear_estatus(ghes);
859
860 ret = NMI_HANDLED;
866 } 861 }
867 862
868#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 863#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
869 irq_work_queue(&ghes_proc_irq_work); 864 irq_work_queue(&ghes_proc_irq_work);
870#endif 865#endif
871
872out:
873 raw_spin_unlock(&ghes_nmi_lock); 866 raw_spin_unlock(&ghes_nmi_lock);
874 return ret; 867 return ret;
875} 868}