All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jean Delvare <jdelvare@suse.de>, linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>,
	"Mingarelli, Thomas" <Thomas.Mingarelli@hp.com>
Subject: Re: [PATCH] watchdog: hpwdt: Add support for WDIOC_SETOPTIONS
Date: Fri, 19 Jun 2015 18:50:35 -0700	[thread overview]
Message-ID: <5584C6EB.9030804@roeck-us.net> (raw)
In-Reply-To: <20150619170125.7634f6e2@endymion.delvare>

Hi Jean,

On 06/19/2015 08:01 AM, Jean Delvare wrote:
> WDIOC_SETOPTIONS makes it possible to disable and re-enable the
> watchdog timer while the hpwdt driver is loaded.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Cc: Wim Van Sebroeck <wim@iguana.be>
> ---
> Untested. It would be great if someone at HP (or anyone with the
> hardware, I guess) could test and review this patch. Thanks.
>

Any chance you can convert the driver to a new style watchdog driver
instead ?

>   drivers/watchdog/hpwdt.c |   19 ++++++++++++++++++-
>   1 file changed, 18 insertions(+), 1 deletion(-)
>
> --- linux-4.1-rc8.orig/drivers/watchdog/hpwdt.c	2015-06-19 11:40:15.885626732 +0200
> +++ linux-4.1-rc8/drivers/watchdog/hpwdt.c	2015-06-19 11:52:14.375776480 +0200
> @@ -588,7 +588,7 @@ static long hpwdt_ioctl(struct file *fil
>   {
>   	void __user *argp = (void __user *)arg;
>   	int __user *p = argp;
> -	int new_margin;
> +	int new_margin, options;
>   	int ret = -ENOTTY;
>
>   	switch (cmd) {
> @@ -608,6 +608,23 @@ static long hpwdt_ioctl(struct file *fil
>   		ret = 0;
>   		break;
>
> +	case WDIOC_SETOPTIONS:
> +		ret = get_user(options, p);
> +		if (ret)
> +			break;
> +
> +		if (options & WDIOS_DISABLECARD) {
> +			hpwdt_stop();
> +			ret = 0;

ret is already 0 here.

> +		}
> +
> +		if (options & WDIOS_ENABLECARD) {
> +			hpwdt_start();
> +			hpwdt_ping();
> +			ret = 0;

Same here.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in

  reply	other threads:[~2015-06-20  1:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 15:01 [PATCH] watchdog: hpwdt: Add support for WDIOC_SETOPTIONS Jean Delvare
2015-06-20  1:50 ` Guenter Roeck [this message]
2015-06-21  7:30   ` Jean Delvare

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=5584C6EB.9030804@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Thomas.Mingarelli@hp.com \
    --cc=jdelvare@suse.de \
    --cc=linux-watchdog@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.