aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHorms <horms@verge.net.au>2006-07-30 06:03:34 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 16:28:39 -0400
commitcea6a4ba8acfba6f59cc9ed71e0d05cb770b9d9c (patch)
tree8a8ad7de11c2261c3f850d97d91524ee64cc36c4 /arch
parentb8bdb460b7ecf08a4fed6e8b5b6b3fe874587aaa (diff)
[PATCH] panic_on_oops: remove ssleep()
This patch is part of an effort to unify the panic_on_oops behaviour across all architectures that implement it. It was pointed out to me by Andi Kleen that if an oops has occured in interrupt context, then calling sleep() in the oops path will only cause a panic, and that it would be really better for it not to be in the path at all. This patch removes the ssleep() call and reworks the console message accordinly. I have a slght concern that the resulting console message is too long, feedback welcome. For powerpc it also unifies the 32bit and 64bit behaviour. Fror x86_64, this patch only updates the console message, as ssleep() is already not present. Signed-off-by: Horms <horms@verge.net.au> Acked-by: Paul Mackerras <paulus@samba.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Andi Kleen <ak@muc.de> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/traps.c7
-rw-r--r--arch/i386/kernel/traps.c8
-rw-r--r--arch/ia64/kernel/traps.c7
-rw-r--r--arch/powerpc/kernel/traps.c10
-rw-r--r--arch/x86_64/kernel/traps.c2
-rw-r--r--arch/xtensa/kernel/traps.c8
6 files changed, 14 insertions, 28 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 35a052fc177a..4e29dd03e582 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -232,11 +232,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
232 bust_spinlocks(0); 232 bust_spinlocks(0);
233 spin_unlock_irq(&die_lock); 233 spin_unlock_irq(&die_lock);
234 234
235 if (panic_on_oops) { 235 if (panic_on_oops)
236 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 236 panic("Fatal exception: panic_on_oops");
237 ssleep(5);
238 panic("Fatal exception");
239 }
240 237
241 do_exit(SIGSEGV); 238 do_exit(SIGSEGV);
242} 239}
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 021f8fdc7512..0d4005dc06c5 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -453,11 +453,9 @@ void die(const char * str, struct pt_regs * regs, long err)
453 if (in_interrupt()) 453 if (in_interrupt())
454 panic("Fatal exception in interrupt"); 454 panic("Fatal exception in interrupt");
455 455
456 if (panic_on_oops) { 456 if (panic_on_oops)
457 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 457 panic("Fatal exception: panic_on_oops");
458 ssleep(5); 458
459 panic("Fatal exception");
460 }
461 oops_exit(); 459 oops_exit();
462 do_exit(SIGSEGV); 460 do_exit(SIGSEGV);
463} 461}
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index e7bbb0f40aa2..5a0420464c6c 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -117,11 +117,8 @@ die (const char *str, struct pt_regs *regs, long err)
117 die.lock_owner = -1; 117 die.lock_owner = -1;
118 spin_unlock_irq(&die.lock); 118 spin_unlock_irq(&die.lock);
119 119
120 if (panic_on_oops) { 120 if (panic_on_oops)
121 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 121 panic("Fatal exception: panic_on_oops");
122 ssleep(5);
123 panic("Fatal exception");
124 }
125 122
126 do_exit(SIGSEGV); 123 do_exit(SIGSEGV);
127} 124}
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 3c668078e524..2105767fcc57 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -150,13 +150,9 @@ int die(const char *str, struct pt_regs *regs, long err)
150 if (in_interrupt()) 150 if (in_interrupt())
151 panic("Fatal exception in interrupt"); 151 panic("Fatal exception in interrupt");
152 152
153 if (panic_on_oops) { 153 if (panic_on_oops)
154#ifdef CONFIG_PPC64 154 panic("Fatal exception: panic_on_oops");
155 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 155
156 ssleep(5);
157#endif
158 panic("Fatal exception");
159 }
160 do_exit(err); 156 do_exit(err);
161 157
162 return 0; 158 return 0;
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index f7a9d1421078..4e9938dee060 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -529,7 +529,7 @@ void __kprobes oops_end(unsigned long flags)
529 /* Nest count reaches zero, release the lock. */ 529 /* Nest count reaches zero, release the lock. */
530 spin_unlock_irqrestore(&die_lock, flags); 530 spin_unlock_irqrestore(&die_lock, flags);
531 if (panic_on_oops) 531 if (panic_on_oops)
532 panic("Oops"); 532 panic("Fatal exception: panic_on_oops");
533} 533}
534 534
535void __kprobes __die(const char * str, struct pt_regs * regs, long err) 535void __kprobes __die(const char * str, struct pt_regs * regs, long err)
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 27e409089a7b..9734960a2451 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -487,11 +487,9 @@ void die(const char * str, struct pt_regs * regs, long err)
487 if (in_interrupt()) 487 if (in_interrupt())
488 panic("Fatal exception in interrupt"); 488 panic("Fatal exception in interrupt");
489 489
490 if (panic_on_oops) { 490 if (panic_on_oops)
491 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 491 panic("Fatal exception: panic_on_oops");
492 ssleep(5); 492
493 panic("Fatal exception");
494 }
495 do_exit(err); 493 do_exit(err);
496} 494}
497 495