linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3 v3] build in panic_timeout value
@ 2013-11-25 23:23 Jason Baron
  2013-11-25 23:23 ` [PATCH 1/3 v3] panic: Make panic_timeout configurable Jason Baron
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jason Baron @ 2013-11-25 23:23 UTC (permalink / raw)
  To: mingo; +Cc: benh, paulus, ralf, akpm, mpe, felipe.contreras, linux-kernel

Hi,

I've now separated out the arch bits into separate patches. Hopefully, it makes
review easier. I also didn't address moving the 'panic_timeout' command-line
parameter up as an 'early_param()'. I think it might make sense to move it up,
especially for distro kernels, but its not a need here, so I didn't want to just
shove it in. If needed, I think it can come in separately, as it shoudn't
affect this series.

Thanks,

-Jason 


v3:
 -separate arch bits
 -drop mips settings of panic_timeout as per Ralf Baechle

v2:
 -restrict arch defaults to arch/ code
 -add set_arch_panic_timeout(), in case .config specifies a non-default timeout

Jason Baron (2):
  panic: Make panic_timeout configurable
  powerpc: cleanup panic_timeout

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(-)

-- 
1.8.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3 v3] panic: Make panic_timeout configurable
  2013-11-25 23:23 [PATCH 0/3 v3] build in panic_timeout value Jason Baron
@ 2013-11-25 23:23 ` Jason Baron
  2013-11-26 14:21   ` [tip:core/debug] " tip-bot for Jason Baron
  2013-11-25 23:23 ` [PATCH 2/3 v3] mips: remove panic_timeout settings Jason Baron
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Jason Baron @ 2013-11-25 23:23 UTC (permalink / raw)
  To: mingo; +Cc: benh, paulus, ralf, akpm, mpe, felipe.contreras, linux-kernel

The panic_timeout value can be set via the command line option 'panic=x', or via
/proc/sys/kernel/panic, however that is not sufficient when the panic occurs
before we are able to set up these values. Thus, add a CONFIG_PANIC_TIMEOUT
so that we can set the desired value from the .config.

The default panic_timeout value continues to be 0 - wait forever. Also adds
set_arch_panic_timeout(new_timeout, arch_default_timeout), which is intended
to be used by arches in arch_setup(). The idea being that the new_timeout
is only set if the user hasn't changed from the arch_default_timeout.

Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 include/linux/kernel.h | 9 +++++++++
 kernel/panic.c         | 2 +-
 lib/Kconfig.debug      | 9 +++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d4e98d1..2ac0277 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -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,
diff --git a/kernel/panic.c b/kernel/panic.c
index c00b4ce..6d63003 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -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);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index db25707..6982094 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -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
-- 
1.8.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3 v3] mips: remove panic_timeout settings
  2013-11-25 23:23 [PATCH 0/3 v3] build in panic_timeout value Jason Baron
  2013-11-25 23:23 ` [PATCH 1/3 v3] panic: Make panic_timeout configurable Jason Baron
@ 2013-11-25 23:23 ` Jason Baron
  2013-11-26 14:21   ` [tip:core/debug] MIPS: Remove " tip-bot for Ralf Baechle
  2013-11-25 23:23 ` [PATCH 3/3 v3] powerpc: cleanup panic_timeout Jason Baron
  2013-11-26 11:17 ` [PATCH 0/3 v3] build in panic_timeout value Ingo Molnar
  3 siblings, 1 reply; 9+ messages in thread
From: Jason Baron @ 2013-11-25 23:23 UTC (permalink / raw)
  To: mingo
  Cc: benh, paulus, ralf, akpm, mpe, felipe.contreras, skuribay,
	linux-kernel, linux-mips

From: Ralf Baechle <ralf@linux-mips.org>

Now that we have a CONFIG_PANIC_TIMEOUT=x setting, remove the mips settings. The
default is 0, which means don't reboot on panic.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Shinya Kuribayashi <skuribay@pobox.com>
Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 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 --
 5 files changed, 8 deletions(-)

diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
index 9a357ff..820b7a3 100644
--- a/arch/mips/ar7/setup.c
+++ b/arch/mips/ar7/setup.c
@@ -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)
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index d710058..9100122 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)
 	iomem_resource.start = EMMA2RH_IO_BASE;
 	iomem_resource.end = EMMA2RH_ROM_BASE - 1;
 
-	/* Reboot on panic */
-	panic_timeout = 180;
-
 	markeins_sio_setup();
 }
 
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 6d981bb..54e75c7 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)
 
 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;
diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c
index 214d123..921be5f 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)
 
 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;
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 41707a2..3462c83 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)
 #error invalid SiByte board configuration
 #endif
 
-	panic_timeout = 5;  /* For debug.  */
-
 	board_be_handler = swarm_be_handler;
 
 	if (xicor_probe())
-- 
1.8.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3 v3] powerpc: cleanup panic_timeout
  2013-11-25 23:23 [PATCH 0/3 v3] build in panic_timeout value Jason Baron
  2013-11-25 23:23 ` [PATCH 1/3 v3] panic: Make panic_timeout configurable Jason Baron
  2013-11-25 23:23 ` [PATCH 2/3 v3] mips: remove panic_timeout settings Jason Baron
@ 2013-11-25 23:23 ` Jason Baron
  2013-11-26 14:21   ` [tip:core/debug] powerpc: Clean up panic_timeout usage tip-bot for Jason Baron
  2013-11-26 11:17 ` [PATCH 0/3 v3] build in panic_timeout value Ingo Molnar
  3 siblings, 1 reply; 9+ messages in thread
From: Jason Baron @ 2013-11-25 23:23 UTC (permalink / raw)
  To: mingo
  Cc: benh, paulus, ralf, akpm, mpe, felipe.contreras, linux-kernel,
	linuxppc-dev

Default CONFIG_PANIC_TIMEOUT to 180 seconds on powerpc. The pSeries continue
to set the timeout to 10 seconds at run-time. Thus, there's a small window
where we don't have the correct value on pSeries, but if this is only run-time
discoverable we don't have a better option. In any case, if the user changes
the default setting of 180 seconds, we honor that user setting.

Signed-off-by: Jason Baron <jbaron@akamai.com>
---
 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 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c..b2be8e8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -147,6 +147,10 @@ config EARLY_PRINTK
 	bool
 	default y
 
+config PANIC_TIMEOUT
+	int
+	default 180
+
 config COMPAT
 	bool
 	default y if PPC64
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 703a841..11ba86e 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);
 void check_for_initrd(void);
 void do_init_bootmem(void);
 void setup_panic(void);
+#define ARCH_PANIC_TIMEOUT 180
 
 #endif /* !__ASSEMBLY__ */
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index b903dc5..2b0da27 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)
 	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();
 
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4085aaa..856dd4e 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)
 	dcache_bsize = ppc64_caches.dline_size;
 	icache_bsize = ppc64_caches.iline_size;
 
-	/* reboot on panic */
-	panic_timeout = 180;
-
 	if (ppc_md.panic)
 		setup_panic();
 
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c1f1908..6f76ae4 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)
 
 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();
-- 
1.8.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3 v3] build in panic_timeout value
  2013-11-25 23:23 [PATCH 0/3 v3] build in panic_timeout value Jason Baron
                   ` (2 preceding siblings ...)
  2013-11-25 23:23 ` [PATCH 3/3 v3] powerpc: cleanup panic_timeout Jason Baron
@ 2013-11-26 11:17 ` Ingo Molnar
  2013-11-27  5:38   ` Felipe Contreras
  3 siblings, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2013-11-26 11:17 UTC (permalink / raw)
  To: Jason Baron; +Cc: benh, paulus, ralf, akpm, mpe, felipe.contreras, linux-kernel


* Jason Baron <jbaron@akamai.com> wrote:

> Hi,
> 
> I've now separated out the arch bits into separate patches. 
> Hopefully, it makes review easier. I also didn't address moving the 
> 'panic_timeout' command-line parameter up as an 'early_param()'. I 
> think it might make sense to move it up, especially for distro 
> kernels, but its not a need here, so I didn't want to just shove it 
> in. If needed, I think it can come in separately, as it shoudn't 
> affect this series.

The series looks good to me, I've applied the patches to 
tip:core/debug.

If Felipe Contreras's fix patch looks good to you then it would also 
be nice if you could send me that as well, on top of your patches.

That fix patch had only one remaining bug/problem, last I checked: if 
panic_timeout is turned into an early_param() then pause_on_oops 
should obviously also be turned into an early param. Changing just one 
of these parameters would be inconsistent and would lead to assymetric 
behavior in the early-crash case.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:core/debug] panic: Make panic_timeout configurable
  2013-11-25 23:23 ` [PATCH 1/3 v3] panic: Make panic_timeout configurable Jason Baron
@ 2013-11-26 14:21   ` tip-bot for Jason Baron
  0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Jason Baron @ 2013-11-26 14:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, torvalds, jbaron, akpm, tglx

Commit-ID:  5800dc3cff87c3a1548382298bb16e1fb4ec7e32
Gitweb:     http://git.kernel.org/tip/5800dc3cff87c3a1548382298bb16e1fb4ec7e32
Author:     Jason Baron <jbaron@akamai.com>
AuthorDate: Mon, 25 Nov 2013 23:23:04 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 26 Nov 2013 12:12:26 +0100

panic: Make panic_timeout configurable

The panic_timeout value can be set via the command line option
'panic=x', or via /proc/sys/kernel/panic, however that is not
sufficient when the panic occurs before we are able to set up
these values. Thus, add a CONFIG_PANIC_TIMEOUT so that we can
set the desired value from the .config.

The default panic_timeout value continues to be 0 - wait
forever. Also adds set_arch_panic_timeout(new_timeout,
arch_default_timeout), which is intended to be used by arches in
arch_setup(). The idea being that the new_timeout is only set if
the user hasn't changed from the arch_default_timeout.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: benh@kernel.crashing.org
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: mpe@ellerman.id.au
Cc: felipe.contreras@gmail.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1a1674daec27c534df409697025ac568ebcee91e.1385418410.git.jbaron@akamai.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/kernel.h | 9 +++++++++
 kernel/panic.c         | 2 +-
 lib/Kconfig.debug      | 9 +++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d4e98d1..2ac0277 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -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,
diff --git a/kernel/panic.c b/kernel/panic.c
index c00b4ce..6d63003 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -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);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index db25707..6982094 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [tip:core/debug] MIPS: Remove panic_timeout settings
  2013-11-25 23:23 ` [PATCH 2/3 v3] mips: remove panic_timeout settings Jason Baron
@ 2013-11-26 14:21   ` tip-bot for Ralf Baechle
  0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Ralf Baechle @ 2013-11-26 14:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, torvalds, jbaron,
	skuribay, ralf, akpm, tglx

Commit-ID:  7972e966b032939afe63d8db22975240879dfd2a
Gitweb:     http://git.kernel.org/tip/7972e966b032939afe63d8db22975240879dfd2a
Author:     Ralf Baechle <ralf@linux-mips.org>
AuthorDate: Mon, 25 Nov 2013 23:23:07 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 26 Nov 2013 12:12:27 +0100

MIPS: Remove panic_timeout settings

Now that we have a CONFIG_PANIC_TIMEOUT=x setting, remove the
mips settings. The default is 0, which means don't reboot on
panic.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Shinya Kuribayashi <skuribay@pobox.com>
Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: benh@kernel.crashing.org
Cc: paulus@samba.org
Cc: mpe@ellerman.id.au
Cc: felipe.contreras@gmail.com
Cc: linux-mips@linux-mips.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/d19dc75fca343ec5d9ada75a1400f57330021976.1385418410.git.jbaron@akamai.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 --
 5 files changed, 8 deletions(-)

diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
index 9a357ff..820b7a3 100644
--- a/arch/mips/ar7/setup.c
+++ b/arch/mips/ar7/setup.c
@@ -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)
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index d710058..9100122 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)
 	iomem_resource.start = EMMA2RH_IO_BASE;
 	iomem_resource.end = EMMA2RH_ROM_BASE - 1;
 
-	/* Reboot on panic */
-	panic_timeout = 180;
-
 	markeins_sio_setup();
 }
 
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 6d981bb..54e75c7 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)
 
 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;
diff --git a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c
index 214d123..921be5f 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)
 
 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;
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 41707a2..3462c83 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)
 #error invalid SiByte board configuration
 #endif
 
-	panic_timeout = 5;  /* For debug.  */
-
 	board_be_handler = swarm_be_handler;
 
 	if (xicor_probe())

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [tip:core/debug] powerpc: Clean up panic_timeout usage
  2013-11-25 23:23 ` [PATCH 3/3 v3] powerpc: cleanup panic_timeout Jason Baron
@ 2013-11-26 14:21   ` tip-bot for Jason Baron
  0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Jason Baron @ 2013-11-26 14:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, torvalds, jbaron, akpm, tglx

Commit-ID:  b71d47c14fba6270c0b5a0d56639bf042017025b
Gitweb:     http://git.kernel.org/tip/b71d47c14fba6270c0b5a0d56639bf042017025b
Author:     Jason Baron <jbaron@akamai.com>
AuthorDate: Mon, 25 Nov 2013 23:23:11 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 26 Nov 2013 12:12:28 +0100

powerpc: Clean up panic_timeout usage

Default CONFIG_PANIC_TIMEOUT to 180 seconds on powerpc. The
pSeries continue to set the timeout to 10 seconds at run-time.

Thus, there's a small window where we don't have the correct
value on pSeries, but if this is only run-time discoverable we
don't have a better option. In any case, if the user changes the
default setting of 180 seconds, we honor that user setting.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: benh@kernel.crashing.org
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: mpe@ellerman.id.au
Cc: felipe.contreras@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/705bbe0f70fb20759151642ba0176a6414ec9f7a.1385418410.git.jbaron@akamai.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c..b2be8e8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -147,6 +147,10 @@ config EARLY_PRINTK
 	bool
 	default y
 
+config PANIC_TIMEOUT
+	int
+	default 180
+
 config COMPAT
 	bool
 	default y if PPC64
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 703a841..11ba86e 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);
 void check_for_initrd(void);
 void do_init_bootmem(void);
 void setup_panic(void);
+#define ARCH_PANIC_TIMEOUT 180
 
 #endif /* !__ASSEMBLY__ */
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index b903dc5..2b0da27 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)
 	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();
 
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4085aaa..856dd4e 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)
 	dcache_bsize = ppc64_caches.dline_size;
 	icache_bsize = ppc64_caches.iline_size;
 
-	/* reboot on panic */
-	panic_timeout = 180;
-
 	if (ppc_md.panic)
 		setup_panic();
 
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c1f1908..6f76ae4 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)
 
 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();

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3 v3] build in panic_timeout value
  2013-11-26 11:17 ` [PATCH 0/3 v3] build in panic_timeout value Ingo Molnar
@ 2013-11-27  5:38   ` Felipe Contreras
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Contreras @ 2013-11-27  5:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Jason Baron, Benjamin Herrenschmidt, Paul Mackerras, ralf,
	Andrew Morton, mpe, Linux Kernel Mailing List

On Tue, Nov 26, 2013 at 5:17 AM, Ingo Molnar <mingo@kernel.org> wrote:
> * Jason Baron <jbaron@akamai.com> wrote:

>> I've now separated out the arch bits into separate patches.
>> Hopefully, it makes review easier. I also didn't address moving the
>> 'panic_timeout' command-line parameter up as an 'early_param()'. I
>> think it might make sense to move it up, especially for distro
>> kernels, but its not a need here, so I didn't want to just shove it
>> in. If needed, I think it can come in separately, as it shoudn't
>> affect this series.
>
> The series looks good to me, I've applied the patches to
> tip:core/debug.
>
> If Felipe Contreras's fix patch looks good to you then it would also
> be nice if you could send me that as well, on top of your patches.

Why? Because for ad hominem reasons you wouldn't take the patch itself
even though it's obviously good?

> That fix patch had only one remaining bug/problem, last I checked: if
> panic_timeout is turned into an early_param() then pause_on_oops
> should obviously also be turned into an early param.

That is not a "problem" with the patch itself, and it's the first time
this "problem" has been mentioned at all.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-27  5:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 23:23 [PATCH 0/3 v3] build in panic_timeout value Jason Baron
2013-11-25 23:23 ` [PATCH 1/3 v3] panic: Make panic_timeout configurable Jason Baron
2013-11-26 14:21   ` [tip:core/debug] " tip-bot for Jason Baron
2013-11-25 23:23 ` [PATCH 2/3 v3] mips: remove panic_timeout settings Jason Baron
2013-11-26 14:21   ` [tip:core/debug] MIPS: Remove " tip-bot for Ralf Baechle
2013-11-25 23:23 ` [PATCH 3/3 v3] powerpc: cleanup panic_timeout Jason Baron
2013-11-26 14:21   ` [tip:core/debug] powerpc: Clean up panic_timeout usage tip-bot for Jason Baron
2013-11-26 11:17 ` [PATCH 0/3 v3] build in panic_timeout value Ingo Molnar
2013-11-27  5:38   ` Felipe Contreras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).