From: Wim Van Sebroeck <wim@iguana.be>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Linux Watchdog Mailing List <linux-watchdog@vger.kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [RFC PATCH] watchdog: ep93xx: Use the WatchDog Timer Driver Core.
Date: Wed, 3 Aug 2011 12:07:16 +0200 [thread overview]
Message-ID: <20110803100716.GS4227@infomag.iguana.be> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F3882B8541@AUSP01VMBX24.collaborationhost.net>
Hi H Hartley,
> > [...]
> >> @@ -210,43 +126,31 @@ static int __init ep93xx_wdt_init(void)
> >> {
> >> int err;
> >>
> >> - err = misc_register(&ep93xx_wdt_miscdev);
> >> + ep93xx_wdd.bootstatus = readl(EP93XX_WDT_WATCHDOG);
> >> + ep93xx_wdd.timeout = timeout;
> >> +
> >> + err = watchdog_register_device(&ep93xx_wdd);
> >> + if (err)
> >> + return err;
> >>
> >> - boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0;
> >> + setup_timer(&timer, ep93xx_timer_ping, 1);
> >
> > Shouldn't the bootstatus setting be:
> > ep93xx_wdd.bootstatus = readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0;
> > (or something similar with the WDIOF_OVERHEAT, ... flags).
>
> The ep93xx watchdog status register doesn't line up nicely with the standard
> WDIOF_* flags. The register has these bits defined:
>
> PLSDN 6 Pulse Disable Not
> OVRID 5 Software Override of HWDIS
> SWDIS 4 Software Watchdog Disable
> HWDIS 3 Hardware Watchdog Disable
> URST 2 User Reset Detected
> 3KRST 1 Three-Key Reset Detected
> WD 0 Watchdog Reset Detected
Hmm, it would be nice to have this info also in the driver. Certainly at least a define for the WD bit.
Secondly: what it is doing now is allready incorrect: The WD bit is returned as bit 0 of the bootstatus value.
This is actually: WDIOF_OVERHEAT (Reset due to CPU overheat) instead of
WDIOF_CARDRESET (0x0020 Card previously reset the CPU)...
> The original bootstatus setting just checked for the WD bit. I would like
> to pass the full status register so that userspace can figure out what caused
> the reset. Is this an inappropriate abuse of WDIOC_GETBOOTSTATUS?
It's indeed an inappropriate abuse of WDIOC_GETBOOTSTATUS.
The WDIOC_GETBOOTSTATUS should return a result for all watchdog drivers.
The result is based on the WDIOF_* flags
This however does not mean that we can add flags. The 'User Reset detected' looks to me as something that can be usefull in embedded environments. We need to think about this and see what would be usefull in general.
Kind regards,
Wim.
next prev parent reply other threads:[~2011-08-03 10:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-01 20:57 H Hartley Sweeten
2011-08-02 9:16 ` Mika Westerberg
2011-08-02 16:55 ` H Hartley Sweeten
2011-08-03 8:15 ` Mika Westerberg
2011-08-03 16:22 ` H Hartley Sweeten
2011-08-03 9:56 ` Wim Van Sebroeck
2011-08-02 9:57 ` Wim Van Sebroeck
2011-08-02 17:02 ` H Hartley Sweeten
2011-08-03 10:07 ` Wim Van Sebroeck [this message]
2011-08-03 16:34 ` H Hartley Sweeten
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=20110803100716.GS4227@infomag.iguana.be \
--to=wim@iguana.be \
--cc=hartleys@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®