diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/debug/debug_core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index ac5c0f9c7a20..0874e2edd275 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c | |||
@@ -696,6 +696,14 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs) | |||
696 | 696 | ||
697 | if (arch_kgdb_ops.enable_nmi) | 697 | if (arch_kgdb_ops.enable_nmi) |
698 | arch_kgdb_ops.enable_nmi(0); | 698 | arch_kgdb_ops.enable_nmi(0); |
699 | /* | ||
700 | * Avoid entering the debugger if we were triggered due to an oops | ||
701 | * but panic_timeout indicates the system should automatically | ||
702 | * reboot on panic. We don't want to get stuck waiting for input | ||
703 | * on such systems, especially if its "just" an oops. | ||
704 | */ | ||
705 | if (signo != SIGTRAP && panic_timeout) | ||
706 | return 1; | ||
699 | 707 | ||
700 | memset(ks, 0, sizeof(struct kgdb_state)); | 708 | memset(ks, 0, sizeof(struct kgdb_state)); |
701 | ks->cpu = raw_smp_processor_id(); | 709 | ks->cpu = raw_smp_processor_id(); |
@@ -828,6 +836,15 @@ static int kgdb_panic_event(struct notifier_block *self, | |||
828 | unsigned long val, | 836 | unsigned long val, |
829 | void *data) | 837 | void *data) |
830 | { | 838 | { |
839 | /* | ||
840 | * Avoid entering the debugger if we were triggered due to a panic | ||
841 | * We don't want to get stuck waiting for input from user in such case. | ||
842 | * panic_timeout indicates the system should automatically | ||
843 | * reboot on panic. | ||
844 | */ | ||
845 | if (panic_timeout) | ||
846 | return NOTIFY_DONE; | ||
847 | |||
831 | if (dbg_kdb_mode) | 848 | if (dbg_kdb_mode) |
832 | kdb_printf("PANIC: %s\n", (char *)data); | 849 | kdb_printf("PANIC: %s\n", (char *)data); |
833 | kgdb_breakpoint(); | 850 | kgdb_breakpoint(); |