Return-Path: Received: from nommos.sslcatacombnetworking.com (nommos.sslcatacombnetworking.com [67.18.224.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 80621DDEC6 for ; Sat, 14 Apr 2007 06:12:13 +1000 (EST) In-Reply-To: <20070413200659.GA21588@blade.az.mvista.com> References: <20070413173524.GA17890@blade.az.mvista.com> <461FCB6F.7010504@ru.mvista.com> <20070413200659.GA21588@blade.az.mvista.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: From: Kumar Gala Subject: Re: [PATCH] add reg and stack dump to booke WD handler Date: Fri, 13 Apr 2007 15:11:51 -0500 To: Dave Jiang Cc: linuxppc-dev@ozlabs.org, paulus@samba.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Apr 13, 2007, at 3:06 PM, Dave Jiang wrote: > 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. Forgot the signed-off-by again (git-commit -s) > -- > > Ok here's try 2. Modified the watchdog driver instead per Sergei's > suggestion. I'm against having a WatchdogHandler in booke_wdt.c. The idea behind the weak symbol in traps.c is to allow platform code to override the behavior. I'm ok if we put the spew in the generic case. Also, how are you testing this? - k > > drivers/char/watchdog/booke_wdt.c | 37 ++++++++++++++++++++++++++ > +++++++++++ > 1 files changed, 37 insertions(+), 0 deletions(-) > > diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/ > watchdog/booke_wdt.c > index 0e23f29..90e5301 100644 > --- a/drivers/char/watchdog/booke_wdt.c > +++ b/drivers/char/watchdog/booke_wdt.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > /* If the kernel parameter wdt_enable=1, the watchdog will be > enabled at boot. > * Also, the wdt_period sets the watchdog timer period timeout. > @@ -47,6 +48,42 @@ u32 booke_wdt_period = WDT_PERIOD_DEFAULT; > #define WDTP(x) (TCR_WP(x)) > #endif > > +void WatchdogHandler(struct pt_regs *regs) > +{ > + unsigned long flags; > + > + mtspr(SPRN_TCR, mfspr(SPRN_TCR) & ~TCR_WIE); > + oops_enter(); > + > + console_verbose(); > + bust_spinlocks(1); > + local_save_flags(flags); > + > +#ifdef CONFIG_PREEMPT > + printk("PREEMPT "); > +#endif > +#ifdef CONFIG_SMP > + printk("SMP NR_CPUS=%d ", NR_CPUS); > +#endif > +#ifdef CONFIG_DEBUG_PAGEALLOC > + printk("DEBUG_PAGEALLOC "); > +#endif > +#ifdef CONFIG_NUMA > + printk("NUMA "); > +#endif > + printk("%s\n", ppc_md.name ? ppc_md.name : ""); > + > + print_modules(); > + show_regs(regs); > + > + bust_spinlocks(0); > + > + printk(KERN_EMERG "Waiting for hardware watchdog reset...\n"); > + /* spin until hardware reset */ > + while(1) > + cpu_relax(); > +} > + > /* > * booke_wdt_ping: > */