linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add reg and stack dump to booke WD handler
@ 2007-04-13 17:35 Dave Jiang
  2007-04-13 17:47 ` oops, forgot to sign off Dave Jiang
  2007-04-13 18:26 ` [PATCH] add reg and stack dump to booke WD handler Sergei Shtylyov
  0 siblings, 2 replies; 10+ messages in thread
From: Dave Jiang @ 2007-04-13 17:35 UTC (permalink / raw)
  To: linuxppc-dev, paulus, galak

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. 

--

 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)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-04-27 16:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-13 17:35 [PATCH] add reg and stack dump to booke WD handler Dave Jiang
2007-04-13 17:47 ` oops, forgot to sign off Dave Jiang
2007-04-13 18:26 ` [PATCH] add reg and stack dump to booke WD handler Sergei Shtylyov
2007-04-13 20:06   ` Dave Jiang
2007-04-13 20:11     ` Kumar Gala
2007-04-13 20:26       ` Dave Jiang
2007-04-13 20:28       ` Sergei Shtylyov
2007-04-13 22:16       ` Dave Jiang
2007-04-24  4:01         ` Paul Mackerras
2007-04-27 17:01         ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).