summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-03-18 04:52:39 -0400
committerBorislav Petkov <bp@suse.de>2015-04-27 15:21:46 -0400
commite10be03f603d521d5c8ac0bb0f48e5723ce19d58 (patch)
treef18b07e36a5e877b27dc34abff63b840128eb801 /drivers/acpi/apei
parent115684961a335a1c97074158e8f789118ac8b00d (diff)
GHES: Carve out the panic functionality
... into another function for more clarity. No functionality change. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index fe1e41bf5609..712ed95b1dca 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -823,6 +823,18 @@ static void __process_error(struct ghes *ghes)
823#endif 823#endif
824} 824}
825 825
826static void __ghes_panic(struct ghes *ghes)
827{
828 oops_begin();
829 ghes_print_queued_estatus();
830 __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
831
832 /* reboot to log the error! */
833 if (panic_timeout == 0)
834 panic_timeout = ghes_panic_timeout;
835 panic("Fatal hardware error!");
836}
837
826static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) 838static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
827{ 839{
828 struct ghes *ghes, *ghes_global = NULL; 840 struct ghes *ghes, *ghes_global = NULL;
@@ -846,16 +858,8 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
846 if (ret == NMI_DONE) 858 if (ret == NMI_DONE)
847 goto out; 859 goto out;
848 860
849 if (sev_global >= GHES_SEV_PANIC) { 861 if (sev_global >= GHES_SEV_PANIC)
850 oops_begin(); 862 __ghes_panic(ghes_global);
851 ghes_print_queued_estatus();
852 __ghes_print_estatus(KERN_EMERG, ghes_global->generic,
853 ghes_global->estatus);
854 /* reboot to log the error! */
855 if (panic_timeout == 0)
856 panic_timeout = ghes_panic_timeout;
857 panic("Fatal hardware error!");
858 }
859 863
860 list_for_each_entry_rcu(ghes, &ghes_nmi, list) { 864 list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
861 if (!(ghes->flags & GHES_TO_CLEAR)) 865 if (!(ghes->flags & GHES_TO_CLEAR))