From: Sergei Shtylyov <sshtylyov@ru•mvista.com>
To: Kumar Gala <galak@kernel•crashing.org>
Cc: linuxppc-dev@ozlabs•org, paulus@samba•org
Subject: Re: [PATCH] add reg and stack dump to booke WD handler
Date: Sat, 14 Apr 2007 00:28:24 +0400 [thread overview]
Message-ID: <461FE7E8.9030500@ru.mvista.com> (raw)
In-Reply-To: <B8CF9F53-9F51-4DD5-9CB6-16C69502A1CA@kernel.crashing.org>
Hello.
Kumar Gala 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.
>> 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.
Hmm, to do what?
> I'm ok if we put the spew in the generic case.
Well, I was mostly against putting there while(1) cpu_relax();
> Also, how are you testing this?
By enabling the watchdog and not then pinging it, I guess...
>> 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 <asm/reg_booke.h>
>> #include <asm/uaccess.h>
>> #include <asm/system.h>
>> +#include <asm/machdep.h>
>>
>> /* 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:
>> */
WBR, Sergei
next prev parent reply other threads:[~2007-04-13 20:27 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 ` [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 [this message]
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=461FE7E8.9030500@ru.mvista.com \
--to=sshtylyov@ru$(echo .)mvista.com \
--cc=galak@kernel$(echo .)crashing.org \
--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