Skip to contentSkip to conversation

RFC: ARM: Ensure backtraces console printing in sleep mode

PATCH New Linus Walleij 2 participants 2 messages Jun 5, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RFC: ARM: Ensure backtraces console printing in sleep mode

From: Aurelien Gerault <[email protected]>

Ensuring that oops & panic messages/backtraces will be printed in console, even if in sleep mode (i.e. when the console is locked).

So, unlock the console before printing.

---
 arch/arm/kernel/traps.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/kernel/traps.c +4 -0
index 4928d89..42a5057 100644
@@ -25,6 +25,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/console.h>
 
 #include <linux/atomic.h>
 #include <asm/cacheflush.h>
@@ -273,6 +274,9 @@ void die(const char *str, struct pt_regs *regs, int err)
 	int ret;
 	enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE;
 
+	/* ensure that backtrace will be printed in console */
+	console_unlock();
+
 	oops_enter();
 
 	raw_spin_lock_irq(&die_lock);
Signature · 1 line
1.7.9.2
#1 lore raw

PATCH 1/1 RFC: ARM: Ensure backtraces console printing in sleep mode

Quoted 7 lines · Linus Walleij

From: Aurelien Gerault <[email protected]>

Ensuring that oops & panic messages/backtraces will be printed in console, even if in sleep mode (i.e. when the console is locked).

So, unlock the console before printing.

I don't think this is a good idea - it totally changes the locking, and probably causes the console lock to become unbalanced, which could be a problem if the oops was non-fatal to the kernel.

x86 also doesn't play this game either, and we really shouldn't have different semantics here.