mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: Robert Yang <hachyang@gmail.com>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	ryang <ryang@hach.com>
Subject: Re: [PATCH 1/1] Watchdog: Fixed the watchdog close/stop logic - only close the watchdog if the magic character was received and the magic close is supported.
Date: Tue, 9 Dec 2014 09:19:34 +0100	[thread overview]
Message-ID: <20141209081934.GN8811@spo001.leaseweb.nl> (raw)
In-Reply-To: <1418060711-47872-1-git-send-email-hachyang@gmail.com>

Hi Ryang,

> From: ryang <ryang@hach.com>
> 
> Signed-off-by: ryang <ryang@hach.com>
> ---
>  drivers/watchdog/watchdog_dev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 6aaefba..73793d8 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -471,8 +471,8 @@ static int watchdog_release(struct inode *inode, struct file *file)
>  	 */
>  	if (!test_bit(WDOG_ACTIVE, &wdd->status))
>  		err = 0;
> -	else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) ||
> -		 !(wdd->info->options & WDIOF_MAGICCLOSE))
> +	else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) &&
> +		(wdd->info->options & WDIOF_MAGICCLOSE))
>  		err = watchdog_stop(wdd);
>  
>  	/* If the watchdog was not stopped, send a keepalive ping */
> -- 

There is no reason for this change; you either have:
1) WDIOF_MAGICCLOSE is not supported and thus watchog may be stopped.
2) If a watchdog daemon crashes and thus closes the watchdog device (and thus it did not sent a Magic Char) then the watchdog should not be stopped but needs to reboot the system.

Kind regards,
Wim.


      parent reply	other threads:[~2014-12-09  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 17:45 Robert Yang
2014-12-08 20:11 ` Guenter Roeck
2014-12-09  8:19 ` Wim Van Sebroeck [this message]

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=20141209081934.GN8811@spo001.leaseweb.nl \
    --to=wim@iguana.be \
    --cc=hachyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=ryang@hach.com \
    /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®