From: Sergei Shtylyov <sshtylyov@ru•mvista.com>
To: Dave Jiang <djiang@mvista•com>
Cc: linuxppc-dev@ozlabs•org, paulus@samba•org
Subject: Re: [PATCH] add reg and stack dump to booke WD handler
Date: Fri, 13 Apr 2007 22:26:55 +0400 [thread overview]
Message-ID: <461FCB6F.7010504@ru.mvista.com> (raw)
In-Reply-To: <20070413173524.GA17890@blade.az.mvista.com>
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.
Why not do this in drivers/watchdog/booke_wdt.c -- WatchdogHandler() is a weak symbol?
> 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",
This partly duplicates printk() in WatchdogException().
> + regs->nip, regs->msr);
These regs are later dumped by show_regs() anyway.
> +#ifdef CONFIG_PREEMPT
> + printk(KERN_ERR "PREEMPT ");
Does specifying loglevel on non '\n' terminated lines really make sense? I suspect all what you'll get will be ugly output with <3> insterted here and there.
> +#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");
A typo here.
> + /* spin until hardware reset */
> + while(1)
> + cpu_relax();
Not even giving it a chance? That's cruel. :-)
Seriously, this seems too specific watchdog behavior to be here.
WBR, Sergei
next prev parent reply other threads:[~2007-04-13 18:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Sergei Shtylyov [this message]
2007-04-13 20:06 ` [PATCH] add reg and stack dump to booke WD handler 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=461FCB6F.7010504@ru.mvista.com \
--to=sshtylyov@ru$(echo .)mvista.com \
--cc=djiang@mvista$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox