linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/6] watchdog: Document reboot API
Date: Thu, 15 May 2014 13:38:20 -0700	[thread overview]
Message-ID: <1400186304-1691-3-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1400186304-1691-1-git-send-email-linux@roeck-us.net>

Document the new reboot API functionality.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v3: Added documentation patch

 Documentation/watchdog/watchdog-kernel-api.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt
index a0438f3..39f8e00 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.txt
@@ -90,6 +90,7 @@ struct watchdog_ops {
 	int (*stop)(struct watchdog_device *);
 	/* optional operations */
 	int (*ping)(struct watchdog_device *);
+	void (*reboot)(struct watchdog_device *);
 	unsigned int (*status)(struct watchdog_device *);
 	int (*set_timeout)(struct watchdog_device *, unsigned int);
 	unsigned int (*get_timeleft)(struct watchdog_device *);
@@ -148,6 +149,8 @@ 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.
+  Parameter is the pointer to the watchdog device.
 * 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 +227,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 to 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

  parent reply	other threads:[~2014-05-15 20:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 20:38 [PATCH v3 0/6] watchdog: Add reboot API Guenter Roeck
2014-05-15 20:38 ` [PATCH v3 1/6] watchdog: Add API to trigger reboots Guenter Roeck
2014-05-15 20:50   ` One Thousand Gnomes
2014-05-15 21:47     ` Guenter Roeck
2014-05-16  1:22   ` [PATCH v4 " Guenter Roeck
2014-05-15 20:38 ` Guenter Roeck [this message]
2014-05-15 20:38 ` [PATCH v3 3/6] arm64: Support reboot through watchdog subsystem Guenter Roeck
2014-05-15 20:38 ` [PATCH v3 4/6] arm: " Guenter Roeck
2014-05-15 20:38 ` [PATCH v3 5/6] watchdog: moxart: Register reboot handler with " Guenter Roeck
2014-05-15 20:38 ` [PATCH v3 6/6] watchdog: sunxi: " Guenter Roeck

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=1400186304-1691-3-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).