core/debug changes for v3.14
Subsystems (3)
Linus,
Please pull the latest core-debug-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-debug-for-linus
# HEAD: b71d47c14fba6270c0b5a0d56639bf042017025b powerpc: Clean up panic_timeout usage
Currently there are two methods to set the panic_timeout: via 'panic=X' boot commandline option, or via /proc/sys/kernel/panic.
This tree adds a third panic_timeout configuration method:
configuration via Kconfig, via CONFIG_PANIC_TIMEOUT=X - useful to distros that generally want their kernel defaults to come with the .config.
CONFIG_PANIC_TIMEOUT defaults to 0, which was the previous default value of panic_timeout.
Doing that unearthed a few arch trickeries regarding arch-special panic_timeout values and related complications - hopefully all resolved to the satisfaction of everyone.
Thanks,
Ingo
------------------>
Jason Baron (2):
panic: Make panic_timeout configurable
powerpc: Clean up panic_timeout usage
Ralf Baechle (1):
MIPS: Remove panic_timeout settings
arch/mips/ar7/setup.c | 1 - arch/mips/emma/markeins/setup.c | 3 --- arch/mips/netlogic/xlp/setup.c | 1 - arch/mips/netlogic/xlr/setup.c | 1 - arch/mips/sibyte/swarm/setup.c | 2 -- arch/powerpc/Kconfig | 4 ++++ arch/powerpc/include/asm/setup.h | 1 + arch/powerpc/kernel/setup_32.c | 3 --- arch/powerpc/kernel/setup_64.c | 3 --- arch/powerpc/platforms/pseries/setup.c | 2 +- include/linux/kernel.h | 9 +++++++++ kernel/panic.c | 2 +- lib/Kconfig.debug | 9 +++++++++ 13 files changed, 25 insertions(+), 16 deletions(-)
arch/mips/ar7/setup.c +0 -1
@@ -92,7 +92,6 @@ void __init plat_mem_setup(void) _machine_restart = ar7_machine_restart; _machine_halt = ar7_machine_halt; pm_power_off = ar7_machine_power_off; - panic_timeout =3 ; io_base = (unsigned long )ioremap (AR7_REGS_BASE ,0x10000 );if (!io_base)
arch/mips/emma/markeins/setup.c +0 -3
@@ -111,9 +111,6 @@ void __init plat_mem_setup(void) iomem_resource.start =EMMA2RH_IO_BASE ; iomem_resource.end =EMMA2RH_ROM_BASE -1 ; -/* Reboot on panic */ - panic_timeout =180 ; -markeins_sio_setup (); }
arch/mips/netlogic/xlp/setup.c +0 -1
@@ -92,7 +92,6 @@ static void __init xlp_init_mem_from_bars(void)void __init plat_mem_setup (void ) { - panic_timeout =5 ; _machine_restart = (void (*)(char *))nlm_linux_exit; _machine_halt = nlm_linux_exit; pm_power_off = nlm_linux_exit;
arch/mips/netlogic/xlr/setup.c +0 -1
@@ -92,7 +92,6 @@ static void nlm_linux_exit(void)void __init plat_mem_setup (void ) { - panic_timeout =5 ; _machine_restart = (void (*)(char *))nlm_linux_exit; _machine_halt = nlm_linux_exit; pm_power_off = nlm_linux_exit;
arch/mips/sibyte/swarm/setup.c +0 -2
@@ -134,8 +134,6 @@ void __init plat_mem_setup(void)#error invalid SiByte board configuration#endif - panic_timeout =5 ;/* For debug. */ - board_be_handler = swarm_be_handler;if (xicor_probe ())
arch/powerpc/Kconfig +4 -0
@@ -147,6 +147,10 @@ config EARLY_PRINTK bool default y +config PANIC_TIMEOUT + int + default 180 + config COMPAT bool default y if PPC64
arch/powerpc/include/asm/setup.h +1 -0
@@ -26,6 +26,7 @@ extern void reloc_got2(unsigned long);void check_for_initrd (void );void do_init_bootmem (void );void setup_panic (void ); +#define ARCH_PANIC_TIMEOUT 180#endif /* !__ASSEMBLY__ */
arch/powerpc/kernel/setup_32.c +0 -3
@@ -296,9 +296,6 @@ void __init setup_arch(char **cmdline_p)if (cpu_has_feature (CPU_FTR_UNIFIED_ID_CACHE )) ucache_bsize = icache_bsize = dcache_bsize; -/* reboot on panic */ - panic_timeout =180 ; -if (ppc_md.panic)setup_panic ();
arch/powerpc/kernel/setup_64.c +0 -3
@@ -588,9 +588,6 @@ void __init setup_arch(char **cmdline_p) dcache_bsize = ppc64_caches.dline_size; icache_bsize = ppc64_caches.iline_size; -/* reboot on panic */ - panic_timeout =180 ; -if (ppc_md.panic)setup_panic ();
arch/powerpc/platforms/pseries/setup.c +1 -1
@@ -470,7 +470,7 @@ static long pseries_little_endian_exceptions(void)static void __init pSeries_setup_arch (void ) { - panic_timeout =10 ; +set_arch_panic_timeout (10 ,ARCH_PANIC_TIMEOUT );/* Discover PIC type and setup ppc_md accordingly */ pseries_discover_pic ();
include/linux/kernel.h +9 -0
@@ -393,6 +393,15 @@ extern int panic_on_oops;extern int panic_on_unrecovered_nmi;extern int panic_on_io_nmi;extern int sysctl_panic_on_stackoverflow; +/* +* Only to be used by arch init code. If the user over-wrote the default +* CONFIG_PANIC_TIMEOUT, honor it. +*/ +static inline void set_arch_panic_timeout (int timeout,int arch_default_timeout) +{ +if (panic_timeout == arch_default_timeout) + panic_timeout = timeout; +}extern const char *print_tainted (void );enum lockdep_ok {LOCKDEP_STILL_OK ,
kernel/panic.c +1 -1
@@ -33,7 +33,7 @@ static int pause_on_oops;static int pause_on_oops_flag;static DEFINE_SPINLOCK (pause_on_oops_lock); -int panic_timeout; +int panic_timeout =CONFIG_PANIC_TIMEOUT ;EXPORT_SYMBOL_GPL (panic_timeout);ATOMIC_NOTIFIER_HEAD (panic_notifier_list);
lib/Kconfig.debug +9 -0
@@ -761,6 +761,15 @@ config PANIC_ON_OOPS_VALUE default 0 if !PANIC_ON_OOPS default 1 if PANIC_ON_OOPS +config PANIC_TIMEOUT + int "panic timeout" + default 0 + help + Set the timeout value (in seconds) until a reboot occurs when the + the kernel panics. If n = 0, then we wait forever. A timeout + value n > 0 will wait n seconds before rebooting, while a timeout + value n < 0 will reboot immediately. + config SCHED_DEBUG bool "Collect scheduler debugging info" depends on DEBUG_KERNEL && PROC_FS