public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Cabrera <acabrera@udio.cujae.edu.cu>
To: Wim Van Sebroeck <wim@iguana.be>, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 7/10 v2] Generic Watchdog Timer Driver
Date: Fri, 24 Jun 2011 16:10:57 -0400	[thread overview]
Message-ID: <4E04EF51.6070604@udio.cujae.edu.cu> (raw)
In-Reply-To: <20110624194136.GZ23305@infomag.iguana.be>

Hi Wim

>>>    static int watchdog_stop(struct watchdog_device *wddev)
>>>    {
>>> -	int err;
>>> +	int err = -1;
>>> +
>>> +	if (test_bit(WDOG_NO_WAY_OUT,&wdd->status))
>>> +		return err;
>>>
>> If you return err at this point you never clean the bit WDOG_ACTIVE then
>> the timer will keep resetting the wdt because the bit is still active.
> If WDOG_ACTIVE is never cleared, then you will need to keep pinging the watchdog
> to not start the reboot. Even when you use the timer (with this code):
>          if (time_before(jiffies, next_heartbeat) ||
>             (!test_bit(WDOG_ACTIVE,&wdt_dev.status))) {
>
> if WDOG_ACTIVE is set then you fall down to: if (time_before(jiffies, next_heartbeat))
> which means that as long that the next_heartbeat time is not there we will keep pinging
> the watchdog device, but as soon as jiffies>  next_heartbeat, the watchdog device will
> not be triggered anymore.
>
> But I see another possible problem here. Will do some special tests first.
>
Sorry, I didn't see the ! operator before test_bit, my mistake !! ;)

best regards
Alejandro

PS: I send a patch some days ago (xilinx watchdog....)...and anyone 
comment it :(. Should I send it again to the list ?



Participe en Universidad 2012, del 13 al 17 de febrero de 2012.
Habana, Cuba: http://www.congresouniversidad.cu
Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu

Participe en el Segundo Congreso Medio Ambiente Construido y 
Desarrollo Sustentable (MACDES 2011) del 6 al 9 de diciembre de 2011, 
Hotel Nacional, Habana, Cuba: http://macdes.cujae.edu.cu

      reply	other threads:[~2011-06-24 20:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-18 17:25 [PATCH 7/10 v2] Generic Watchdog Timer Driver Wim Van Sebroeck
2011-06-18 19:07 ` Arnd Bergmann
2011-06-19 10:03   ` Alan Cox
2011-06-19 11:25     ` Arnd Bergmann
2011-06-19 14:19       ` Alan Cox
2011-06-19 17:29         ` Mark Lord
2011-06-22 20:13           ` Wim Van Sebroeck
2011-06-23 14:13             ` Mark Lord
2011-06-24 14:55               ` Arnd Bergmann
2011-06-24 19:17                 ` Wim Van Sebroeck
2011-06-24 21:14                   ` Arnd Bergmann
2011-06-22 19:56   ` Wim Van Sebroeck
2011-06-22 21:25 ` Alejandro Cabrera
2011-06-24 19:41   ` Wim Van Sebroeck
2011-06-24 20:10     ` Alejandro Cabrera [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=4E04EF51.6070604@udio.cujae.edu.cu \
    --to=acabrera@udio.cujae.edu.cu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox