All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Markus Mayer <markus.mayer@linaro.org>, Wim Van Sebroeck <wim@iguana.be>
Cc: Linux Watchdog <linux-watchdog@vger.kernel.org>
Subject: Re: Disabling watchdog when closing /dev/watchdog
Date: Sat, 12 Oct 2013 15:28:16 -0700	[thread overview]
Message-ID: <5259CD00.7050009@roeck-us.net> (raw)
In-Reply-To: <CAPdLdqnz9EpW5S4OSh_2mokWH36n5zO0q-7MMuctRL_LQTYsNQ@mail.gmail.com>

On 10/09/2013 04:47 PM, Markus Mayer wrote:
> Currently, the watchdog framework works such that upon closing
> /dev/watchdog it will attempt to disable the watchdog timer and,
> failing that, will poke the watchdog (via the watchdog_release()
> function).
>
> I am working on a new watchdog driver for a Broadcom SoC, and for test
> purposes at least, it would be helpful if the watchdog could be left
> alone when the device is closed (i.e. the watchdog is neither stopped
> nor poked). That way I could use a command line utility to issue ioctl
> calls and observe the effect of these calls.
>
> Right now, using my line tool to check the "time left" will return the
> proper amount of time left, but it will also poke the watchdog,
> therefore changing the time that's actually left until the watchdog
> expires (the command line tool opens /dev/watchdog, issues an ioctl
> and closes /dev/watchdog), turning a "read-only" operation into one
> that actually changes the watchdog's status.
>
> Automatically stopping or poking the watchdog upon close only makes
> sense in the case of a continuously running daemon that keeps
> /dev/watchdog open at all times. It doesn't work for case where an
> application would open the watchdog device only for brief amounts of
> time.
>
> Would it make sense to add a flag like "WDOG_LEAVE_ON" to, say, struct
> watchdog_device's "status" values, which the driver could set,
> allowing watchdog_release() to leave the watchdog alone upon closing
> the device? Or is there a different way to achieve this? A daemon is
> not practicable for me at this point, and even later on, we may not
> want to go with a daemon solution, but may want to rely on the
> watchdog continuing to run even if the device is closed.
>

It might make more sense to use sysfs attributes to provide this
functionality (name, status, ping, configured timeout, time left,
reboot reason, ...). I think that would be much cleaner and accomplish
the same. Another option might be debugfs if this is supposed
to be used for debugging only.

Thanks,
Guenter


      reply	other threads:[~2013-10-12 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 23:47 Disabling watchdog when closing /dev/watchdog Markus Mayer
2013-10-12 22:28 ` Guenter Roeck [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=5259CD00.7050009@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=markus.mayer@linaro.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.