From: michele.dionisio@gmail.com
To: wim@linux-watchdog.org, linux@roeck-us.net,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Michele Dionisio <michele.dionisio@powersoft.com>,
Michele Dionisio <michele.dionisio@gmail.com>
Subject: watchdog: davinci_wdt: add possibility to configure watchdog period
Date: Mon, 16 Jul 2018 14:19:09 +0200 [thread overview]
Message-ID: <20180716121909.4869-2-michele.dionisio@gmail.com> (raw)
In-Reply-To: <20180716121909.4869-1-michele.dionisio@gmail.com>
From: Michele Dionisio <michele.dionisio@powersoft.com>
It is not possible to implement setting of watchdog period because it is
not possible to stop watchdog so it is nice to have possibility to
configure watchdog period at module loading.
Signed-off-by: Michele Dionisio <michele.dionisio@gmail.com>
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index 6c6594261cb7..5f95afa20fee 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -54,6 +54,10 @@
#define WDKEY_SEQ0 (0xa5c6 << 16)
#define WDKEY_SEQ1 (0xda7e << 16)
+static unsigned int init_timeout;
+module_param(init_timeout, uint, 0);
+MODULE_PARM_DESC(init_timeout, "initial watchdog timeout (in seconds)");
+
static int heartbeat;
/*
@@ -223,8 +227,10 @@ static int davinci_wdt_probe(struct platform_device *pdev)
wdd->ops = &davinci_wdt_ops;
wdd->min_timeout = 1;
wdd->max_timeout = MAX_HEARTBEAT;
- wdd->timeout = DEFAULT_HEARTBEAT;
- wdd->parent = &pdev->dev;
+ if ((init_timeout >= 1) && (init_timeout <= MAX_HEARTBEAT))
+ wdd->timeout = init_timeout;
+ else
+ wdd->timeout = DEFAULT_HEARTBEAT;
watchdog_init_timeout(wdd, heartbeat, dev);
next prev parent reply other threads:[~2018-07-16 12:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 12:19 michele.dionisio
2018-07-16 12:19 ` michele.dionisio [this message]
2018-07-16 13:31 ` Guenter Roeck
2018-07-16 14:04 ` Michele Dionisio
2018-07-16 14:12 ` Guenter Roeck
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=20180716121909.4869-2-michele.dionisio@gmail.com \
--to=michele.dionisio@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michele.dionisio@powersoft.com \
--cc=wim@linux-watchdog.org \
/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®