oops, forgot to sign off

Dave Jiang djiang at mvista.com
Sat Apr 14 03:47:13 EST 2007


Have the booke watchdog dump some useful information when triggered. Hopefully
that'll give the user some hint of what happened rather than just a mysterious
reboot.

Signed-off-by: Dave Jiang <djiang at mvista.com>

--

 arch/powerpc/kernel/traps.c |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index f786222..1af83b7 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1108,9 +1108,42 @@ void unrecoverable_exception(struct pt_regs *regs)
  */
 void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
 {
+	unsigned long flags;
+
 	/* Generic WatchdogHandler, implement your own */
 	mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
-	return;
+	oops_enter();
+
+	console_verbose();
+	bust_spinlocks(1);
+	local_save_flags(flags);
+
+	printk(KERN_ERR "PowerPC Book-E Watchdog detected LOCKUP\n");
+	printk(KERN_ERR "Watchdog exception at PC=%lx MSR=%lx\n",
+			regs->nip, regs->msr);
+#ifdef CONFIG_PREEMPT
+	printk(KERN_ERR "PREEMPT ");
+#endif
+#ifdef CONFIG_SMP
+	printk(KERN_ERR "SMP NR_CPUS=%d ", NR_CPUS);
+#endif
+#ifdef CONFIG_DEBUG_PAGEALLOC
+	printk(KERN_ERR "DEBUG_PAGEALLOC ");
+#endif
+#ifdef CONFIG_NUMA
+	printk(KERN_ERR "NUMA ");
+#endif
+	printk(KERN_ERR "%s\n", ppc_md.name ? ppc_md.name : "");
+
+	print_modules();
+	show_regs(regs);
+
+	bust_spinlocks(0);
+
+	printk(KERN_ERR "Wating for hardware watchdog reset...\n");
+	/* spin until hardware reset */
+	while(1)
+		cpu_relax();
 }
 
 void WatchdogException(struct pt_regs *regs)



More information about the Linuxppc-dev mailing list