File tree Expand file tree Collapse file tree 13 files changed +25
-16
lines changed Expand file tree Collapse file tree 13 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ void __init plat_mem_setup(void)
92
92
_machine_restart = ar7_machine_restart ;
93
93
_machine_halt = ar7_machine_halt ;
94
94
pm_power_off = ar7_machine_power_off ;
95
- panic_timeout = 3 ;
96
95
97
96
io_base = (unsigned long )ioremap (AR7_REGS_BASE , 0x10000 );
98
97
if (!io_base )
Original file line number Diff line number Diff line change @@ -111,9 +111,6 @@ void __init plat_mem_setup(void)
111
111
iomem_resource .start = EMMA2RH_IO_BASE ;
112
112
iomem_resource .end = EMMA2RH_ROM_BASE - 1 ;
113
113
114
- /* Reboot on panic */
115
- panic_timeout = 180 ;
116
-
117
114
markeins_sio_setup ();
118
115
}
119
116
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ static void __init xlp_init_mem_from_bars(void)
92
92
93
93
void __init plat_mem_setup (void )
94
94
{
95
- panic_timeout = 5 ;
96
95
_machine_restart = (void (* )(char * ))nlm_linux_exit ;
97
96
_machine_halt = nlm_linux_exit ;
98
97
pm_power_off = nlm_linux_exit ;
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ static void nlm_linux_exit(void)
92
92
93
93
void __init plat_mem_setup (void )
94
94
{
95
- panic_timeout = 5 ;
96
95
_machine_restart = (void (* )(char * ))nlm_linux_exit ;
97
96
_machine_halt = nlm_linux_exit ;
98
97
pm_power_off = nlm_linux_exit ;
Original file line number Diff line number Diff line change @@ -134,8 +134,6 @@ void __init plat_mem_setup(void)
134
134
#error invalid SiByte board configuration
135
135
#endif
136
136
137
- panic_timeout = 5 ; /* For debug. */
138
-
139
137
board_be_handler = swarm_be_handler ;
140
138
141
139
if (xicor_probe ())
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ config EARLY_PRINTK
147
147
bool
148
148
default y
149
149
150
+ config PANIC_TIMEOUT
151
+ int
152
+ default 180
153
+
150
154
config COMPAT
151
155
bool
152
156
default y if PPC64
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ extern void reloc_got2(unsigned long);
26
26
void check_for_initrd (void );
27
27
void do_init_bootmem (void );
28
28
void setup_panic (void );
29
+ #define ARCH_PANIC_TIMEOUT 180
29
30
30
31
#endif /* !__ASSEMBLY__ */
31
32
Original file line number Diff line number Diff line change @@ -296,9 +296,6 @@ void __init setup_arch(char **cmdline_p)
296
296
if (cpu_has_feature (CPU_FTR_UNIFIED_ID_CACHE ))
297
297
ucache_bsize = icache_bsize = dcache_bsize ;
298
298
299
- /* reboot on panic */
300
- panic_timeout = 180 ;
301
-
302
299
if (ppc_md .panic )
303
300
setup_panic ();
304
301
Original file line number Diff line number Diff line change @@ -588,9 +588,6 @@ void __init setup_arch(char **cmdline_p)
588
588
dcache_bsize = ppc64_caches .dline_size ;
589
589
icache_bsize = ppc64_caches .iline_size ;
590
590
591
- /* reboot on panic */
592
- panic_timeout = 180 ;
593
-
594
591
if (ppc_md .panic )
595
592
setup_panic ();
596
593
Original file line number Diff line number Diff line change @@ -470,7 +470,7 @@ static long pseries_little_endian_exceptions(void)
470
470
471
471
static void __init pSeries_setup_arch (void )
472
472
{
473
- panic_timeout = 10 ;
473
+ set_arch_panic_timeout ( 10 , ARCH_PANIC_TIMEOUT ) ;
474
474
475
475
/* Discover PIC type and setup ppc_md accordingly */
476
476
pseries_discover_pic ();
Original file line number Diff line number Diff line change @@ -394,6 +394,15 @@ extern int panic_on_oops;
394
394
extern int panic_on_unrecovered_nmi ;
395
395
extern int panic_on_io_nmi ;
396
396
extern 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
+ */
401
+ static 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
+ }
397
406
extern const char * print_tainted (void );
398
407
enum lockdep_ok {
399
408
LOCKDEP_STILL_OK ,
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ static int pause_on_oops;
33
33
static int pause_on_oops_flag ;
34
34
static DEFINE_SPINLOCK (pause_on_oops_lock );
35
35
36
- int panic_timeout ;
36
+ int panic_timeout = CONFIG_PANIC_TIMEOUT ;
37
37
EXPORT_SYMBOL_GPL (panic_timeout );
38
38
39
39
ATOMIC_NOTIFIER_HEAD (panic_notifier_list );
Original file line number Diff line number Diff line change @@ -761,6 +761,15 @@ config PANIC_ON_OOPS_VALUE
761
761
default 0 if !PANIC_ON_OOPS
762
762
default 1 if PANIC_ON_OOPS
763
763
764
+ config 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
+
764
773
config SCHED_DEBUG
765
774
bool "Collect scheduler debugging info"
766
775
depends on DEBUG_KERNEL && PROC_FS
You can’t perform that action at this time.
0 commit comments