Skip to content

Commit 4302fbc

Browse files
Hugh Dickinstorvalds
authored andcommitted
panic: panic=-1 for immediate reboot
When a kernel BUG or oops occurs, ChromeOS intends to panic and immediately reboot, with stacktrace and other messages preserved in RAM across reboot. But the longer we delay, the more likely the user is to poweroff and lose the info. panic_timeout (seconds before rebooting) is set by panic= boot option or sysctl or /proc/sys/kernel/panic; but 0 means wait forever, so at present we have to delay at least 1 second. Let a negative number mean reboot immediately (with the small cosmetic benefit of suppressing that newline-less "Rebooting in %d seconds.." message). Signed-off-by: Hugh Dickins <hughd@chromium.org> Signed-off-by: Mandeep Singh Baines <msb@chromium.org> Cc: Huang Ying <ying.huang@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Hugh Dickins <hughd@google.com> Cc: Olaf Hering <olaf@aepfle.de> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Dave Airlie <airlied@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3f0fb4e commit 4302fbc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
18461846
See Documentation/sound/oss/oss-parameters.txt
18471847

18481848
panic= [KNL] Kernel behaviour on panic: delay <timeout>
1849-
seconds before rebooting
1849+
timeout > 0: seconds before rebooting
1850+
timeout = 0: wait forever
1851+
timeout < 0: reboot immediately
18501852
Format: <timeout>
18511853

18521854
parkbd.port= [HW] Parallel port number the keyboard adapter is

‎kernel/panic.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ NORET_TYPE void panic(const char * fmt, ...)
119119
}
120120
mdelay(PANIC_TIMER_STEP);
121121
}
122+
}
123+
if (panic_timeout != 0) {
122124
/*
123125
* This will not be a clean reboot, with everything
124126
* shutting down. But if there is a chance of

0 commit comments

Comments
 (0)