Re: watchdog: davinci_wdt: add possibility to configure watchdog period

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/16/2018 05:19 AM, michele.dionisio@xxxxxxxxx wrote:
From: Michele Dionisio <michele.dionisio@xxxxxxxxxxxxx>

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@xxxxxxxxx>

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);

NACK. This is done with the 'heartbeat' module parameter already.

Guenter


--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux