Skip to content

Commit

Permalink
Merge branch 'core-debug-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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
  • Loading branch information
torvalds committed Jan 20, 2014
2 parents 9451ee2 + b71d47c commit 897aea3
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 16 deletions.
1 change: 0 additions & 1 deletion arch/mips/ar7/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions arch/mips/emma/markeins/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
1 change: 0 additions & 1 deletion arch/mips/netlogic/xlp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion arch/mips/netlogic/xlr/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions arch/mips/sibyte/swarm/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 4 additions & 0 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ config EARLY_PRINTK
bool
default y

config PANIC_TIMEOUT
int
default 180

config COMPAT
bool
default y if PPC64
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 9 additions & 0 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,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,
Expand Down
2 changes: 1 addition & 1 deletion kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 897aea3

Please sign in to comment.