From: Guenter Roeck <linux@roeck-us.net>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Wim Van Sebroeck <wim@iguana.be>,
Catalin Marinas <catalin.marinas@arm.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Will Deacon <will.deacon@arm.com>, Arnd Bergmann <arnd@arndb.de>,
Heiko Stuebner <heiko@sntech.de>,
Russell King <linux@arm.linux.org.uk>,
Jonas Jensen <jonas.jensen@gmail.com>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: [PATCH 6/5] watchdog: Document reboot API
Date: Sat, 10 May 2014 09:23:29 -0700 [thread overview]
Message-ID: <20140510162329.GA19884@roeck-us.net> (raw)
In-Reply-To: <536D74E3.8010609@infradead.org>
Document the new reboot API functionality.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Documentation/watchdog/watchdog-kernel-api.txt | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
index a0438f3..f8f0f18 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.txt
@@ -90,6 +90,8 @@ struct watchdog_ops {
int (*stop)(struct watchdog_device *);
/* optional operations */
int (*ping)(struct watchdog_device *);
+ void (*reboot)(struct watchdog_device *, enum reboot_mode,
+ const char *);
unsigned int (*status)(struct watchdog_device *);
int (*set_timeout)(struct watchdog_device *, unsigned int);
unsigned int (*get_timeleft)(struct watchdog_device *);
@@ -148,6 +150,10 @@ they are supported. These optional routines/operations are:
info structure).
* status: this routine checks the status of the watchdog timer device. The
status of the device is reported with watchdog WDIOF_* status flags/bits.
+* reboot: if this routine is present, it may be called to reboot the system.
+ Parameters are the pointer to the watchdog device, the reboot mode, and a
+ command string. The latter two parameters are the system reboot mode
+ and the cmd parameter passed to machine_restart().
* set_timeout: this routine checks and changes the timeout of the watchdog
timer device. It returns 0 on success, -EINVAL for "parameter out of range"
and -EIO for "could not write value to the watchdog". On success this
@@ -224,3 +230,11 @@ the device tree (if the module timeout parameter is invalid). Best practice is
to set the default timeout value as timeout value in the watchdog_device and
then use this function to set the user "preferred" timeout value.
This routine returns zero on success and a negative errno code for failure.
+
+The watchdog_do_reboot function can be used reboot the system. This is intended
+to be used in systems which do not have an explicit reboot capability, but
+implement reboot by programming the watchdog to expire immediately. If the
+function is called, and a watchdog driver with reboot functionality was
+previously registered, the reboot function of that driver will be called.
+Architecture code should call watchdog_do_reboot from its machine_reboot
+function after other means to reboot the system failed.
--
1.9.1
next prev parent reply other threads:[~2014-05-10 16:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-10 0:31 [PATCH v2 0/5] watchdog: Add reboot API Guenter Roeck
2014-05-10 0:31 ` [PATCH v2 1/5] watchdog: Add API to trigger reboots Guenter Roeck
2014-05-10 0:31 ` [PATCH v2 2/5] arm64: Support reboot through watchdog subsystem Guenter Roeck
2014-05-15 1:37 ` Guenter Roeck
2014-05-15 9:09 ` Will Deacon
2014-05-15 16:50 ` Guenter Roeck
2014-05-10 0:31 ` [PATCH v2 3/5] arm: " Guenter Roeck
2014-05-15 1:37 ` Guenter Roeck
2014-05-10 0:31 ` [PATCH 4/5] watchdog: moxart: Register reboot handler with " Guenter Roeck
2014-05-10 0:31 ` [PATCH v2 5/5] watchdog: sunxi: " Guenter Roeck
2014-05-10 0:37 ` [PATCH v2 0/5] watchdog: Add reboot API Randy Dunlap
2014-05-10 0:53 ` Guenter Roeck
2014-05-10 16:23 ` Guenter Roeck [this message]
2014-05-10 21:01 ` [PATCH 6/5] watchdog: Document " Randy Dunlap
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=20140510162329.GA19884@roeck-us.net \
--to=linux@roeck-us.net \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=heiko@sntech.de \
--cc=jonas.jensen@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=maxime.ripard@free-electrons.com \
--cc=rdunlap@infradead.org \
--cc=will.deacon@arm.com \
--cc=wim@iguana.be \
/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