Lines Matching +full:watchdog +full:- +full:timeout +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * 60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x
8 * any of this software. This material is provided "AS-IS" in
13 * 12/4 - 2000 [Initial revision]
14 * 25/4 - 2000 Added /dev/watchdog support
15 * 09/5 - 2001 [smj@oro.net] fixed fop_write to "return 1"
17 * 12/4 - 2002 [rob@osinvestor.com] eliminate fop_read
28 * 09/8 - 2003 [wim@iguana.be] cleanup of trailing spaces
30 * made timeout (the emulated heartbeat) a
39 * *) The driver will ping the watchdog by itself, because this
40 * particular WDT has a very short timeout (one second) and it
53 #include <linux/watchdog.h>
67 * You must set these - The driver cannot probe for the settings
79 * The 60xx board can use watchdog timeout values from one second
81 * the watchdog every ~250ms we should be safe.
89 * char to /dev/watchdog every 30 seconds.
95 #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */
96 static int timeout = WATCHDOG_TIMEOUT; /* in seconds, multiplied by HZ to variable
98 module_param(timeout, int, 0);
99 MODULE_PARM_DESC(timeout,
100 "Watchdog timeout in seconds. (1<=timeout<=3600, default="
106 "Watchdog cannot be stopped once started (default="
127 /* Re-set the timer interval */ in wdt_timer_ping()
130 pr_warn("Heartbeat lost! Will not ping the watchdog\n"); in wdt_timer_ping()
139 next_heartbeat = jiffies + (timeout * HZ); in wdt_startup()
143 pr_info("Watchdog timer is now enabled\n"); in wdt_startup()
151 pr_info("Watchdog timer is now disabled...\n"); in wdt_turnoff()
157 next_heartbeat = jiffies + (timeout * HZ); in wdt_keepalive()
161 * /dev/watchdog handling
181 return -EFAULT; in fop_write()
198 return -EBUSY; in fop_open()
234 return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; in fop_ioctl()
240 int new_options, retval = -EINVAL; in fop_ioctl()
242 return -EFAULT; in fop_ioctl()
260 return -EFAULT; in fop_ioctl()
263 return -EINVAL; in fop_ioctl()
265 timeout = new_timeout; in fop_ioctl()
270 return put_user(timeout, p); in fop_ioctl()
272 return -ENOTTY; in fop_ioctl()
288 .name = "watchdog",
328 int rc = -EBUSY; in sbc60xxwdt_init()
330 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ in sbc60xxwdt_init()
331 timeout = WATCHDOG_TIMEOUT; in sbc60xxwdt_init()
332 pr_info("timeout value must be 1 <= x <= 3600, using %d\n", in sbc60xxwdt_init()
333 timeout); in sbc60xxwdt_init()
338 rc = -EIO; in sbc60xxwdt_init()
342 /* We cannot reserve 0x45 - the kernel already has! */ in sbc60xxwdt_init()
346 rc = -EIO; in sbc60xxwdt_init()
363 pr_info("WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n", in sbc60xxwdt_init()
364 timeout, nowayout); in sbc60xxwdt_init()
383 MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver");