From: Simon Kagstrom <simon.kagstrom@netinsight.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2]: common: Add a watchdog CLI command
Date: Wed, 28 Oct 2009 15:49:25 +0100 [thread overview]
Message-ID: <20091028154925.1dd1a8a9@marrow.netinsight.se> (raw)
In-Reply-To: <73173D32E9439E4ABB5151606C3E19E202F200E72E@SC-VEXCH1.marvell.com>
On Wed, 28 Oct 2009 07:29:35 -0700
Prafulla Wadaskar <prafulla@marvell.com> wrote:
> > +static int do_watchdog(cmd_tbl_t *cmdtp, int flag, int argc,
> >
> > + if (timeout < 0)
> > + goto usage;
>
> How about passing zero value here, will it be a correct input for watchdog_enable?
Good point, I'll update the patch.
> > +
> > + /* Everything fine, enable the watchdog */
> > + watchdog_enable(timeout);
>
> Can we check for some error code here from lower layer and dump some error message?
> For ex. Specified timeout value may be invalid for specific h/w
We could, but I'd like to keep the interface simple. Basically: tell
the hardware driver to enable the watchdog "as good as possible", and
then the hardware will enable a watchdog that will timeout "sometime".
This is hardly an end-user issue anyway: he/she will test the board
properly to find a good timeout value anyway, and I believe the
interface can be kept simple. I just like it since it makes it simple
to enable the watchdog where you like it in boot scripts etc.
> > +#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
> > +extern void watchdog_enable(unsigned int timeout_secs);
> > +
> > +extern void watchdog_disable(void);
> > +#else
> > +static inline void watchdog_enable(unsigned int timeout_secs) { }
> > +static inline void watchdog_disable(void) { }
> > +#endif
> > +
>
> What does this means?
It was just a way of making the interface calls valid (but empty) if
the watchdog support isn't there. The idea is to avoid #ifdefs in the
code (like for WATCHDOG_RESET).
// Simon
next prev parent reply other threads:[~2009-10-28 14:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-28 14:11 [U-Boot] [PATCH 0/2]: Watchdog support from the command line Simon Kagstrom
2009-10-28 14:14 ` [U-Boot] [PATCH 1/2]: common: Add a watchdog CLI command Simon Kagstrom
2009-10-28 14:29 ` Prafulla Wadaskar
2009-10-28 14:49 ` Simon Kagstrom [this message]
2009-10-28 15:56 ` Wolfgang Denk
2009-10-28 14:15 ` [U-Boot] [PATCH 2/2]: arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards Simon Kagstrom
2009-10-28 15:41 ` Prafulla Wadaskar
2009-10-29 8:07 ` [U-Boot] [PATCH v2 0/2]: Watchdog support from the command line Simon Kagstrom
2009-10-29 8:09 ` [U-Boot] [PATCH v2 1/2]: common: Add a watchdog CLI command Simon Kagstrom
2009-10-29 8:29 ` Prafulla Wadaskar
2009-11-06 9:28 ` Simon Kagstrom
2009-11-06 9:34 ` Prafulla Wadaskar
2009-11-06 11:18 ` Mike Frysinger
2009-10-29 8:11 ` [U-Boot] [PATCH v2 2/2]: arm:kirkwood: Add hardware watchdog support for Marvell Kirkwood boards Simon Kagstrom
2009-10-29 8:32 ` Prafulla Wadaskar
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=20091028154925.1dd1a8a9@marrow.netinsight.se \
--to=simon.kagstrom@netinsight.net \
--cc=u-boot@lists.denx.de \
/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