mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: LKML <linux-kernel@vger.kernel.org>,
	Linux Watchdog Mailing List <linux-watchdog@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 3/10 v2] Generic Watchdog Timer Driver
Date: Sat, 18 Jun 2011 19:21:36 +0200	[thread overview]
Message-ID: <20110618172136.GD3441@infomag.iguana.be> (raw)

watchdog: WatchDog Timer Driver Core - Part 3

This part add's the WDIOC_KEEPALIVE ioctl functionality to the
WatchDog Timer Driver Core framework. Please note that the
WDIOF_KEEPALIVEPING bit has to be set in the watchdog_info
options field.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

diff -urN linux-2.6.38-generic-part2/Documentation/watchdog/src/watchdog-with-timer-example.c linux-2.6.38-generic-part3/Documentation/watchdog/src/watchdog-with-timer-example.c
--- linux-2.6.38-generic-part2/Documentation/watchdog/src/watchdog-with-timer-example.c	2011-06-16 20:07:44.671177621 +0200
+++ linux-2.6.38-generic-part3/Documentation/watchdog/src/watchdog-with-timer-example.c	2011-06-16 20:07:53.631174037 +0200
@@ -117,6 +117,7 @@
  */
 static const struct watchdog_info wdt_info = {
 	.identity =	DRV_NAME,
+	.options =	WDIOF_KEEPALIVEPING,
 };
 
 static const struct watchdog_ops wdt_ops = {
diff -urN linux-2.6.38-generic-part2/Documentation/watchdog/watchdog-kernel-api.txt linux-2.6.38-generic-part3/Documentation/watchdog/watchdog-kernel-api.txt
--- linux-2.6.38-generic-part2/Documentation/watchdog/watchdog-kernel-api.txt	2011-06-16 16:57:31.388541823 +0200
+++ linux-2.6.38-generic-part3/Documentation/watchdog/watchdog-kernel-api.txt	2011-06-16 18:44:20.747179936 +0200
@@ -101,6 +101,9 @@
   the watchdog timer driver core does: to send a keepalive ping to the watchdog
   timer hardware it will either use the ping operation (when available) or the
   start operation (when the ping operation is not available).
+  (Note: the WDIOC_KEEPALIVE ioctl call will only be active when the
+  WDIOF_KEEPALIVEPING bit has been set in the option field on the watchdog's
+  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.
 
diff -urN linux-2.6.38-generic-part2/drivers/watchdog/core/watchdog_dev.c linux-2.6.38-generic-part3/drivers/watchdog/core/watchdog_dev.c
--- linux-2.6.38-generic-part2/drivers/watchdog/core/watchdog_dev.c	2011-06-16 19:34:22.927178838 +0200
+++ linux-2.6.38-generic-part3/drivers/watchdog/core/watchdog_dev.c	2011-06-16 19:35:22.415178710 +0200
@@ -153,6 +153,11 @@
 		return put_user(val, p);
 	case WDIOC_GETBOOTSTATUS:
 		return put_user(wdd->bootstatus, p);
+	case WDIOC_KEEPALIVE:
+		if (!(wdd->info->options & WDIOF_KEEPALIVEPING))
+			return -EOPNOTSUPP;
+		watchdog_ping(wdd);
+		return 0;
 	default:
 		return -ENOTTY;
 	}

             reply	other threads:[~2011-06-18 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-18 17:21 Wim Van Sebroeck [this message]
2011-06-18 19:01 ` Arnd Bergmann

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=20110618172136.GD3441@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.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

all inboxes | Powered by JetHome®