linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lisovy Rostislav <lisovy@gmail.com>
To: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Cc: Michal Vokac <michal.vokac@comap.cz>
Subject: Watchdog start during boot
Date: Tue, 09 Sep 2014 12:29:29 +0200	[thread overview]
Message-ID: <1410258569.15354.3.camel@lp-lvrv.comap.cz> (raw)

Hello;
If my understanding is correct, the purpose of the "watchdog subsystem"
is to provide an unified interface from user-space to watchdog devices
(via /dev). The issue I am trying to solve is how to start the watchdog
during boot (it would be sufficient just not to disable it since the
bootloader enables it) to be controlled later on with the user-space
tool -- i.e. when the user-space will not boot properly, I would like
the device to be rebooted.

My "quick and dirty" device-specific solution is:

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 3691b15..1e44b03f 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -53,6 +53,10 @@ static unsigned timer_margin;
 module_param(timer_margin, uint, 0);
 MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
 
+static bool start_on_boot = false;
+module_param(start_on_boot, bool, 0);
+MODULE_PARM_DESC(start_on_boot, "Start the watchdog during boot");
+
 struct omap_wdt_dev {
        void __iomem    *base;          /* physical */
        struct device   *dev;
@@ -269,6 +273,9 @@ static int omap_wdt_probe(struct platform_device *pdev)
 
        pm_runtime_put_sync(wdev->dev);
 
+       if (start_on_boot)
+               omap_wdt_start(omap_wdt);
+
        return 0;
 }

however I think it would be much beneficial to do this in a generic way.
Maybe to create a device tree property, that would store some flag to
start the watchdog during boot?

Your opinion is appreciated.
 
Best regards;
Rostislav Lisovy



             reply	other threads:[~2014-09-09 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 10:29 Lisovy Rostislav [this message]
2014-09-09 10:45 ` Watchdog start during boot Janusz Użycki
2014-09-09 11:00 ` Markus Pargmann
2014-09-09 11:48   ` Janusz Użycki

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=1410258569.15354.3.camel@lp-lvrv.comap.cz \
    --to=lisovy@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=michal.vokac@comap.cz \
    /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;
as well as URLs for NNTP newsgroup(s).