aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 13:22:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 13:22:12 -0500
commit897aea303fec0c24b2a21b8e29f45dc73a234555 (patch)
tree511f235fa422163b7a1c8bc58b4d65bd245ec5c8
parent9451ee2d17e6b4bfbc5871f3c86ea744581b0413 (diff)
parentb71d47c14fba6270c0b5a0d56639bf042017025b (diff)
Merge branch 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core debug changes from Ingo Molnar: "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" * 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: powerpc: Clean up panic_timeout usage MIPS: Remove panic_timeout settings panic: Make panic_timeout configurable
-rw-r--r--arch/mips/ar7/setup.c1
-rw-r--r--arch/mips/emma/markeins/setup.c3
-rw-r--r--arch/mips/netlogic/xlp/setup.c1
-rw-r--r--arch/mips/netlogic/xlr/setup.c1
-rw-r--r--arch/mips/sibyte/swarm/setup.c2
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/include/asm/setup.h1
-rw-r--r--arch/powerpc/kernel/setup_32.c3
-rw-r--r--arch/powerpc/kernel/setup_64.c3
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--include/linux/kernel.h9
-rw-r--r--kernel/panic.c2
-rw-r--r--lib/Kconfig.debug9
13 files changed, 25 insertions, 16 deletions
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
index 9a357fffcfbe..820b7a313d9b 100644
--- a/arch/mips/ar7/setup.c
+++ b/arch/mips/ar7/setup.c
@@ -92,7 +92,6 @@ void __init plat_mem_setup(void)
92 _machine_restart = ar7_machine_restart; 92 _machine_restart = ar7_machine_restart;
93 _machine_halt = ar7_machine_halt; 93 _machine_halt = ar7_machine_halt;
94 pm_power_off = ar7_machine_power_off; 94 pm_power_off = ar7_machine_power_off;
95 panic_timeout = 3;
96 95
97 io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000); 96 io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000);
98 if (!io_base) 97 if (!io_base)
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index d71005835c00..9100122e5cef 100644
--- a/arch/mips/emma/markeins/setup.c
+++ b/arch/mips/emma/markeins/setup.c
@@ -111,9 +111,6 @@ void __init plat_mem_setup(void)
111 iomem_resource.start = EMMA2RH_IO_BASE; 111 iomem_resource.start = EMMA2RH_IO_BASE;
112 iomem_resource.end = EMMA2RH_ROM_BASE - 1; 112 iomem_resource.end = EMMA2RH_ROM_BASE - 1;
113 113
114 /* Reboot on panic */
115 panic_timeout = 180;
116
117 markeins_sio_setup(); 114 markeins_sio_setup();
118} 115}
119 116
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 6d981bb337ec..54e75c77184b 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -92,7 +92,6 @@ static void __init xlp_init_mem_from_bars(void)
92 92
93void __init plat_mem_setup(void) 93void __init plat_mem_setup(void)
94{ 94{
95 panic_timeout = 5;
96 _machine_restart = (void (*)(char *))nlm_linux_exit; 95 _machine_restart = (void (*)(char *))nlm_linux_exit;
97 _machine_halt = nlm_linux_exit; 96 _machine_halt = nlm_linux_exit;
98 pm_power_off = nlm_linux_exit; 97 pm_power_off = nlm_linux_exit;
diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c
index 214d123b79fa..921be5f77797 100644
--- a/arch/mips/netlogic/xlr/setup.c
+++ b/arch/mips/netlogic/xlr/setup.c
@@ -92,7 +92,6 @@ static void nlm_linux_exit(void)
92 92
93void __init plat_mem_setup(void) 93void __init plat_mem_setup(void)
94{ 94{
95 panic_timeout = 5;
96 _machine_restart = (void (*)(char *))nlm_linux_exit; 95 _machine_restart = (void (*)(char *))nlm_linux_exit;
97 _machine_halt = nlm_linux_exit; 96 _machine_halt = nlm_linux_exit;
98 pm_power_off = nlm_linux_exit; 97 pm_power_off = nlm_linux_exit;
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 41707a245dea..3462c831d0ea 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -134,8 +134,6 @@ void __init plat_mem_setup(void)
134#error invalid SiByte board configuration 134#error invalid SiByte board configuration
135#endif 135#endif
136 136
137 panic_timeout = 5; /* For debug. */
138
139 board_be_handler = swarm_be_handler; 137 board_be_handler = swarm_be_handler;
140 138
141 if (xicor_probe()) 139 if (xicor_probe())
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c0a8f0..b2be8e8cb5c7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -147,6 +147,10 @@ config EARLY_PRINTK
147 bool 147 bool
148 default y 148 default y
149 149
150config PANIC_TIMEOUT
151 int
152 default 180
153
150config COMPAT 154config COMPAT
151 bool 155 bool
152 default y if PPC64 156 default y if PPC64
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 703a8412dac2..11ba86e17631 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -26,6 +26,7 @@ extern void reloc_got2(unsigned long);
26void check_for_initrd(void); 26void check_for_initrd(void);
27void do_init_bootmem(void); 27void do_init_bootmem(void);
28void setup_panic(void); 28void setup_panic(void);
29#define ARCH_PANIC_TIMEOUT 180
29 30
30#endif /* !__ASSEMBLY__ */ 31#endif /* !__ASSEMBLY__ */
31 32
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index b903dc5cf944..2b0da27eaee4 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -296,9 +296,6 @@ void __init setup_arch(char **cmdline_p)
296 if (cpu_has_feature(CPU_FTR_UNIFIED_ID_CACHE)) 296 if (cpu_has_feature(CPU_FTR_UNIFIED_ID_CACHE))
297 ucache_bsize = icache_bsize = dcache_bsize; 297 ucache_bsize = icache_bsize = dcache_bsize;
298 298
299 /* reboot on panic */
300 panic_timeout = 180;
301
302 if (ppc_md.panic) 299 if (ppc_md.panic)
303 setup_panic(); 300 setup_panic();
304 301
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4085aaa9478f..856dd4e99bfe 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -588,9 +588,6 @@ void __init setup_arch(char **cmdline_p)
588 dcache_bsize = ppc64_caches.dline_size; 588 dcache_bsize = ppc64_caches.dline_size;
589 icache_bsize = ppc64_caches.iline_size; 589 icache_bsize = ppc64_caches.iline_size;
590 590
591 /* reboot on panic */
592 panic_timeout = 180;
593
594 if (ppc_md.panic) 591 if (ppc_md.panic)
595 setup_panic(); 592 setup_panic();
596 593
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c1f190858701..6f76ae417f47 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -470,7 +470,7 @@ static long pseries_little_endian_exceptions(void)
470 470
471static void __init pSeries_setup_arch(void) 471static void __init pSeries_setup_arch(void)
472{ 472{
473 panic_timeout = 10; 473 set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
474 474
475 /* Discover PIC type and setup ppc_md accordingly */ 475 /* Discover PIC type and setup ppc_md accordingly */
476 pseries_discover_pic(); 476 pseries_discover_pic();
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ecb87544cc5d..2aa3d4b000e6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -394,6 +394,15 @@ extern int panic_on_oops;
394extern int panic_on_unrecovered_nmi; 394extern int panic_on_unrecovered_nmi;
395extern int panic_on_io_nmi; 395extern int panic_on_io_nmi;
396extern int sysctl_panic_on_stackoverflow; 396extern int sysctl_panic_on_stackoverflow;
397/*
398 * Only to be used by arch init code. If the user over-wrote the default
399 * CONFIG_PANIC_TIMEOUT, honor it.
400 */
401static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout)
402{
403 if (panic_timeout == arch_default_timeout)
404 panic_timeout = timeout;
405}
397extern const char *print_tainted(void); 406extern const char *print_tainted(void);
398enum lockdep_ok { 407enum lockdep_ok {
399 LOCKDEP_STILL_OK, 408 LOCKDEP_STILL_OK,
diff --git a/kernel/panic.c b/kernel/panic.c
index c00b4ceb39e8..6d6300375090 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -33,7 +33,7 @@ static int pause_on_oops;
33static int pause_on_oops_flag; 33static int pause_on_oops_flag;
34static DEFINE_SPINLOCK(pause_on_oops_lock); 34static DEFINE_SPINLOCK(pause_on_oops_lock);
35 35
36int panic_timeout; 36int panic_timeout = CONFIG_PANIC_TIMEOUT;
37EXPORT_SYMBOL_GPL(panic_timeout); 37EXPORT_SYMBOL_GPL(panic_timeout);
38 38
39ATOMIC_NOTIFIER_HEAD(panic_notifier_list); 39ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index db25707aa41b..6982094a7e74 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -761,6 +761,15 @@ config PANIC_ON_OOPS_VALUE
761 default 0 if !PANIC_ON_OOPS 761 default 0 if !PANIC_ON_OOPS
762 default 1 if PANIC_ON_OOPS 762 default 1 if PANIC_ON_OOPS
763 763
764config PANIC_TIMEOUT
765 int "panic timeout"
766 default 0
767 help
768 Set the timeout value (in seconds) until a reboot occurs when the
769 the kernel panics. If n = 0, then we wait forever. A timeout
770 value n > 0 will wait n seconds before rebooting, while a timeout
771 value n < 0 will reboot immediately.
772
764config SCHED_DEBUG 773config SCHED_DEBUG
765 bool "Collect scheduler debugging info" 774 bool "Collect scheduler debugging info"
766 depends on DEBUG_KERNEL && PROC_FS 775 depends on DEBUG_KERNEL && PROC_FS