diff options
author | Per Fransson <per.xx.fransson@stericsson.com> | 2011-09-23 14:11:24 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2011-12-06 10:50:49 +0100 |
commit | c886c5a3d04dde01a06eb358078899ee26ed6ec5 (patch) | |
tree | 1a8212d36e6d4f491be0302d445e10e65191a4a4 | |
parent | c6a93cc7f87848aa5320725f2dc440321fb3c30f (diff) |
ux500: Start crash dump through SW reset
When using kexec/kdump without an crash kernel image loaded:
* clean the caches and write the crash_notes
* perform a restart
ST-Ericsson ID: 340331
Change-Id: I1ae34ed2b5e43da4849650a8a7d2f1e453dcbe93
Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32678
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r-- | arch/arm/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/kernel/machine_kexec.c | 10 | ||||
-rw-r--r-- | include/linux/kexec.h | 1 | ||||
-rw-r--r-- | kernel/kexec.c | 10 |
4 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 959fc3738d2..0ec3f620d71 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1895,6 +1895,13 @@ config KEXEC initially work for you. It may help to enable device hotplugging support. +config CRASH_SWRESET + bool "Perform a software reset at a panic (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on KEXEC + help + If no crash kernel has been loaded, perform a SW reset as plan B. + config ATAGS_PROC bool "Export atags in procfs" depends on KEXEC diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index ae1d73a15d3..2a9c3430115 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c @@ -123,3 +123,13 @@ void machine_kexec(struct kimage *image) flush_cache_all(); cpu_reset(reboot_code_buffer_phys); } + +void machine_crash_swreset(void) +{ + printk(KERN_INFO "Software reset on panic!\n"); + + flush_cache_all(); + outer_flush_all(); + outer_disable(); + arm_pm_restart(0, NULL); +} diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 76b4db78ec1..f36d95a8223 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -110,6 +110,7 @@ struct kimage { /* kexec interface functions */ extern void machine_kexec(struct kimage *image); +extern void machine_crash_swreset(void); extern int machine_kexec_prepare(struct kimage *image); extern void machine_kexec_cleanup(struct kimage *image); extern asmlinkage long sys_kexec_load(unsigned long entry, diff --git a/kernel/kexec.c b/kernel/kexec.c index cfb421ddae2..1d6121de24f 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -1069,6 +1069,7 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, void crash_kexec(struct pt_regs *regs) { + struct pt_regs fixed_regs; /* Take the kexec_mutex here to prevent sys_kexec_load * running on one cpu from replacing the crash kernel * we are using after a panic on a different cpu. @@ -1079,7 +1080,6 @@ void crash_kexec(struct pt_regs *regs) */ if (mutex_trylock(&kexec_mutex)) { if (kexec_crash_image) { - struct pt_regs fixed_regs; kmsg_dump(KMSG_DUMP_KEXEC); @@ -1088,6 +1088,14 @@ void crash_kexec(struct pt_regs *regs) machine_crash_shutdown(&fixed_regs); machine_kexec(kexec_crash_image); } +#ifdef CONFIG_CRASH_SWRESET + else { + crash_setup_regs(&fixed_regs, regs); + crash_save_vmcoreinfo(); + machine_crash_shutdown(&fixed_regs); + machine_crash_swreset(); + } +#endif mutex_unlock(&kexec_mutex); } } |