aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/watchdog
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-12 13:53:01 -0400
committerJonathan Corbet <corbet@lwn.net>2019-06-14 16:32:05 -0400
commitcc2a2d19f896d174cad16c2348100bec49c00958 (patch)
tree7388950abbca008741c0c59db1429c50e064ffda /Documentation/watchdog
parent458f69ef36656dc74679667380422dd8063eabfb (diff)
docs: watchdog: convert docs to ReST and rename to *.rst
Convert those documents and prepare them to be part of the kernel API book, as most of the stuff there are related to the Kernel interfaces. Still, in the future, it would make sense to split the docs, as some of the stuff is clearly focused on sysadmin tasks. The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r--Documentation/watchdog/convert_drivers_to_kernel_api.rst (renamed from Documentation/watchdog/convert_drivers_to_kernel_api.txt)109
-rw-r--r--Documentation/watchdog/hpwdt.rst (renamed from Documentation/watchdog/hpwdt.txt)25
-rw-r--r--Documentation/watchdog/index.rst25
-rw-r--r--Documentation/watchdog/mlx-wdt.rst (renamed from Documentation/watchdog/mlx-wdt.txt)24
-rw-r--r--Documentation/watchdog/pcwd-watchdog.rst (renamed from Documentation/watchdog/pcwd-watchdog.txt)13
-rw-r--r--Documentation/watchdog/watchdog-api.rst (renamed from Documentation/watchdog/watchdog-api.txt)76
-rw-r--r--Documentation/watchdog/watchdog-kernel-api.rst (renamed from Documentation/watchdog/watchdog-kernel-api.txt)91
-rw-r--r--Documentation/watchdog/watchdog-parameters.rst736
-rw-r--r--Documentation/watchdog/watchdog-parameters.txt410
-rw-r--r--Documentation/watchdog/watchdog-pm.rst (renamed from Documentation/watchdog/watchdog-pm.txt)3
-rw-r--r--Documentation/watchdog/wdt.rst (renamed from Documentation/watchdog/wdt.txt)31
11 files changed, 997 insertions, 546 deletions
diff --git a/Documentation/watchdog/convert_drivers_to_kernel_api.txt b/Documentation/watchdog/convert_drivers_to_kernel_api.rst
index 9fffb2958d13..dd934cc08e40 100644
--- a/Documentation/watchdog/convert_drivers_to_kernel_api.txt
+++ b/Documentation/watchdog/convert_drivers_to_kernel_api.rst
@@ -1,7 +1,9 @@
1=========================================================
1Converting old watchdog drivers to the watchdog framework 2Converting old watchdog drivers to the watchdog framework
2by Wolfram Sang <w.sang@pengutronix.de>
3========================================================= 3=========================================================
4 4
5by Wolfram Sang <w.sang@pengutronix.de>
6
5Before the watchdog framework came into the kernel, every driver had to 7Before the watchdog framework came into the kernel, every driver had to
6implement the API on its own. Now, as the framework factored out the common 8implement the API on its own. Now, as the framework factored out the common
7components, those drivers can be lightened making it a user of the framework. 9components, those drivers can be lightened making it a user of the framework.
@@ -69,16 +71,16 @@ Here is a overview of the functions and probably needed actions:
69 -ENOIOCTLCMD, the IOCTLs of the framework will be tried, too. Any other error 71 -ENOIOCTLCMD, the IOCTLs of the framework will be tried, too. Any other error
70 is directly given to the user. 72 is directly given to the user.
71 73
72Example conversion: 74Example conversion::
73 75
74-static const struct file_operations s3c2410wdt_fops = { 76 -static const struct file_operations s3c2410wdt_fops = {
75- .owner = THIS_MODULE, 77 - .owner = THIS_MODULE,
76- .llseek = no_llseek, 78 - .llseek = no_llseek,
77- .write = s3c2410wdt_write, 79 - .write = s3c2410wdt_write,
78- .unlocked_ioctl = s3c2410wdt_ioctl, 80 - .unlocked_ioctl = s3c2410wdt_ioctl,
79- .open = s3c2410wdt_open, 81 - .open = s3c2410wdt_open,
80- .release = s3c2410wdt_release, 82 - .release = s3c2410wdt_release,
81-}; 83 -};
82 84
83Check the functions for device-specific stuff and keep it for later 85Check the functions for device-specific stuff and keep it for later
84refactoring. The rest can go. 86refactoring. The rest can go.
@@ -89,24 +91,24 @@ Remove the miscdevice
89 91
90Since the file_operations are gone now, you can also remove the 'struct 92Since the file_operations are gone now, you can also remove the 'struct
91miscdevice'. The framework will create it on watchdog_dev_register() called by 93miscdevice'. The framework will create it on watchdog_dev_register() called by
92watchdog_register_device(). 94watchdog_register_device()::
93 95
94-static struct miscdevice s3c2410wdt_miscdev = { 96 -static struct miscdevice s3c2410wdt_miscdev = {
95- .minor = WATCHDOG_MINOR, 97 - .minor = WATCHDOG_MINOR,
96- .name = "watchdog", 98 - .name = "watchdog",
97- .fops = &s3c2410wdt_fops, 99 - .fops = &s3c2410wdt_fops,
98-}; 100 -};
99 101
100 102
101Remove obsolete includes and defines 103Remove obsolete includes and defines
102------------------------------------ 104------------------------------------
103 105
104Because of the simplifications, a few defines are probably unused now. Remove 106Because of the simplifications, a few defines are probably unused now. Remove
105them. Includes can be removed, too. For example: 107them. Includes can be removed, too. For example::
106 108
107- #include <linux/fs.h> 109 - #include <linux/fs.h>
108- #include <linux/miscdevice.h> (if MODULE_ALIAS_MISCDEV is not used) 110 - #include <linux/miscdevice.h> (if MODULE_ALIAS_MISCDEV is not used)
109- #include <linux/uaccess.h> (if no custom IOCTLs are used) 111 - #include <linux/uaccess.h> (if no custom IOCTLs are used)
110 112
111 113
112Add the watchdog operations 114Add the watchdog operations
@@ -121,30 +123,30 @@ change the function header. Other changes are most likely not needed, because
121here simply happens the direct hardware access. If you have device-specific 123here simply happens the direct hardware access. If you have device-specific
122code left from the above steps, it should be refactored into these callbacks. 124code left from the above steps, it should be refactored into these callbacks.
123 125
124Here is a simple example: 126Here is a simple example::
125 127
126+static struct watchdog_ops s3c2410wdt_ops = { 128 +static struct watchdog_ops s3c2410wdt_ops = {
127+ .owner = THIS_MODULE, 129 + .owner = THIS_MODULE,
128+ .start = s3c2410wdt_start, 130 + .start = s3c2410wdt_start,
129+ .stop = s3c2410wdt_stop, 131 + .stop = s3c2410wdt_stop,
130+ .ping = s3c2410wdt_keepalive, 132 + .ping = s3c2410wdt_keepalive,
131+ .set_timeout = s3c2410wdt_set_heartbeat, 133 + .set_timeout = s3c2410wdt_set_heartbeat,
132+}; 134 +};
133 135
134A typical function-header change looks like: 136A typical function-header change looks like::
135 137
136-static void s3c2410wdt_keepalive(void) 138 -static void s3c2410wdt_keepalive(void)
137+static int s3c2410wdt_keepalive(struct watchdog_device *wdd) 139 +static int s3c2410wdt_keepalive(struct watchdog_device *wdd)
138 { 140 {
139... 141 ...
140+ 142 +
141+ return 0; 143 + return 0;
142 } 144 }
143 145
144... 146 ...
145 147
146- s3c2410wdt_keepalive(); 148 - s3c2410wdt_keepalive();
147+ s3c2410wdt_keepalive(&s3c2410_wdd); 149 + s3c2410wdt_keepalive(&s3c2410_wdd);
148 150
149 151
150Add the watchdog device 152Add the watchdog device
@@ -159,12 +161,12 @@ static variables. Those have to be converted to use the members in
159watchdog_device. Note that the timeout values are unsigned int. Some drivers 161watchdog_device. Note that the timeout values are unsigned int. Some drivers
160use signed int, so this has to be converted, too. 162use signed int, so this has to be converted, too.
161 163
162Here is a simple example for a watchdog device: 164Here is a simple example for a watchdog device::
163 165
164+static struct watchdog_device s3c2410_wdd = { 166 +static struct watchdog_device s3c2410_wdd = {
165+ .info = &s3c2410_wdt_ident, 167 + .info = &s3c2410_wdt_ident,
166+ .ops = &s3c2410wdt_ops, 168 + .ops = &s3c2410wdt_ops,
167+}; 169 +};
168 170
169 171
170Handle the 'nowayout' feature 172Handle the 'nowayout' feature
@@ -173,12 +175,12 @@ Handle the 'nowayout' feature
173A few drivers use nowayout statically, i.e. there is no module parameter for it 175A few drivers use nowayout statically, i.e. there is no module parameter for it
174and only CONFIG_WATCHDOG_NOWAYOUT determines if the feature is going to be 176and only CONFIG_WATCHDOG_NOWAYOUT determines if the feature is going to be
175used. This needs to be converted by initializing the status variable of the 177used. This needs to be converted by initializing the status variable of the
176watchdog_device like this: 178watchdog_device like this::
177 179
178 .status = WATCHDOG_NOWAYOUT_INIT_STATUS, 180 .status = WATCHDOG_NOWAYOUT_INIT_STATUS,
179 181
180Most drivers, however, also allow runtime configuration of nowayout, usually 182Most drivers, however, also allow runtime configuration of nowayout, usually
181by adding a module parameter. The conversion for this would be something like: 183by adding a module parameter. The conversion for this would be something like::
182 184
183 watchdog_set_nowayout(&s3c2410_wdd, nowayout); 185 watchdog_set_nowayout(&s3c2410_wdd, nowayout);
184 186
@@ -191,15 +193,15 @@ Register the watchdog device
191 193
192Replace misc_register(&miscdev) with watchdog_register_device(&watchdog_dev). 194Replace misc_register(&miscdev) with watchdog_register_device(&watchdog_dev).
193Make sure the return value gets checked and the error message, if present, 195Make sure the return value gets checked and the error message, if present,
194still fits. Also convert the unregister case. 196still fits. Also convert the unregister case::
195 197
196- ret = misc_register(&s3c2410wdt_miscdev); 198 - ret = misc_register(&s3c2410wdt_miscdev);
197+ ret = watchdog_register_device(&s3c2410_wdd); 199 + ret = watchdog_register_device(&s3c2410_wdd);
198 200
199... 201 ...
200 202
201- misc_deregister(&s3c2410wdt_miscdev); 203 - misc_deregister(&s3c2410wdt_miscdev);
202+ watchdog_unregister_device(&s3c2410_wdd); 204 + watchdog_unregister_device(&s3c2410_wdd);
203 205
204 206
205Update the Kconfig-entry 207Update the Kconfig-entry
@@ -207,7 +209,7 @@ Update the Kconfig-entry
207 209
208The entry for the driver now needs to select WATCHDOG_CORE: 210The entry for the driver now needs to select WATCHDOG_CORE:
209 211
210+ select WATCHDOG_CORE 212 + select WATCHDOG_CORE
211 213
212 214
213Create a patch and send it to upstream 215Create a patch and send it to upstream
@@ -215,4 +217,3 @@ Create a patch and send it to upstream
215 217
216Make sure you understood Documentation/process/submitting-patches.rst and send your patch to 218Make sure you understood Documentation/process/submitting-patches.rst and send your patch to
217linux-watchdog@vger.kernel.org. We are looking forward to it :) 219linux-watchdog@vger.kernel.org. We are looking forward to it :)
218
diff --git a/Documentation/watchdog/hpwdt.txt b/Documentation/watchdog/hpwdt.rst
index aaa9e4b4bdcd..94a96371113e 100644
--- a/Documentation/watchdog/hpwdt.txt
+++ b/Documentation/watchdog/hpwdt.rst
@@ -1,7 +1,12 @@
1===========================
2HPE iLO NMI Watchdog Driver
3===========================
4
5for iLO based ProLiant Servers
6==============================
7
1Last reviewed: 08/20/2018 8Last reviewed: 08/20/2018
2 9
3 HPE iLO NMI Watchdog Driver
4 for iLO based ProLiant Servers
5 10
6 The HPE iLO NMI Watchdog driver is a kernel module that provides basic 11 The HPE iLO NMI Watchdog driver is a kernel module that provides basic
7 watchdog functionality and handler for the iLO "Generate NMI to System" 12 watchdog functionality and handler for the iLO "Generate NMI to System"
@@ -20,23 +25,26 @@ Last reviewed: 08/20/2018
20 25
21 The hpwdt driver also has the following module parameters: 26 The hpwdt driver also has the following module parameters:
22 27
23 soft_margin - allows the user to set the watchdog timer value. 28 ============ ================================================================
29 soft_margin allows the user to set the watchdog timer value.
24 Default value is 30 seconds. 30 Default value is 30 seconds.
25 timeout - an alias of soft_margin. 31 timeout an alias of soft_margin.
26 pretimeout - allows the user to set the watchdog pretimeout value. 32 pretimeout allows the user to set the watchdog pretimeout value.
27 This is the number of seconds before timeout when an 33 This is the number of seconds before timeout when an
28 NMI is delivered to the system. Setting the value to 34 NMI is delivered to the system. Setting the value to
29 zero disables the pretimeout NMI. 35 zero disables the pretimeout NMI.
30 Default value is 9 seconds. 36 Default value is 9 seconds.
31 nowayout - basic watchdog parameter that does not allow the timer to 37 nowayout basic watchdog parameter that does not allow the timer to
32 be restarted or an impending ASR to be escaped. 38 be restarted or an impending ASR to be escaped.
33 Default value is set when compiling the kernel. If it is set 39 Default value is set when compiling the kernel. If it is set
34 to "Y", then there is no way of disabling the watchdog once 40 to "Y", then there is no way of disabling the watchdog once
35 it has been started. 41 it has been started.
42 ============ ================================================================
36 43
37 NOTE: More information about watchdog drivers in general, including the ioctl 44 NOTE:
45 More information about watchdog drivers in general, including the ioctl
38 interface to /dev/watchdog can be found in 46 interface to /dev/watchdog can be found in
39 Documentation/watchdog/watchdog-api.txt and Documentation/IPMI.txt. 47 Documentation/watchdog/watchdog-api.rst and Documentation/IPMI.txt.
40 48
41 Due to limitations in the iLO hardware, the NMI pretimeout if enabled, 49 Due to limitations in the iLO hardware, the NMI pretimeout if enabled,
42 can only be set to 9 seconds. Attempts to set pretimeout to other 50 can only be set to 9 seconds. Attempts to set pretimeout to other
@@ -63,4 +71,3 @@ Last reviewed: 08/20/2018
63 71
64 The HPE iLO NMI Watchdog Driver and documentation were originally developed 72 The HPE iLO NMI Watchdog Driver and documentation were originally developed
65 by Tom Mingarelli. 73 by Tom Mingarelli.
66
diff --git a/Documentation/watchdog/index.rst b/Documentation/watchdog/index.rst
new file mode 100644
index 000000000000..33a0de631e84
--- /dev/null
+++ b/Documentation/watchdog/index.rst
@@ -0,0 +1,25 @@
1:orphan:
2
3======================
4Linux Watchdog Support
5======================
6
7.. toctree::
8 :maxdepth: 1
9
10 hpwdt
11 mlx-wdt
12 pcwd-watchdog
13 watchdog-api
14 watchdog-kernel-api
15 watchdog-parameters
16 watchdog-pm
17 wdt
18 convert_drivers_to_kernel_api
19
20.. only:: subproject and html
21
22 Indices
23 =======
24
25 * :ref:`genindex`
diff --git a/Documentation/watchdog/mlx-wdt.txt b/Documentation/watchdog/mlx-wdt.rst
index 66eeb78505c3..bf5bafac47f0 100644
--- a/Documentation/watchdog/mlx-wdt.txt
+++ b/Documentation/watchdog/mlx-wdt.rst
@@ -1,5 +1,9 @@
1 Mellanox watchdog drivers 1=========================
2 for x86 based system switches 2Mellanox watchdog drivers
3=========================
4
5for x86 based system switches
6=============================
3 7
4This driver provides watchdog functionality for various Mellanox 8This driver provides watchdog functionality for various Mellanox
5Ethernet and Infiniband switch systems. 9Ethernet and Infiniband switch systems.
@@ -9,16 +13,16 @@ Mellanox watchdog device is implemented in a programmable logic device.
9There are 2 types of HW watchdog implementations. 13There are 2 types of HW watchdog implementations.
10 14
11Type 1: 15Type 1:
12Actual HW timeout can be defined as a power of 2 msec. 16 Actual HW timeout can be defined as a power of 2 msec.
13e.g. timeout 20 sec will be rounded up to 32768 msec. 17 e.g. timeout 20 sec will be rounded up to 32768 msec.
14The maximum timeout period is 32 sec (32768 msec.), 18 The maximum timeout period is 32 sec (32768 msec.),
15Get time-left isn't supported 19 Get time-left isn't supported
16 20
17Type 2: 21Type 2:
18Actual HW timeout is defined in sec. and it's the same as 22 Actual HW timeout is defined in sec. and it's the same as
19a user-defined timeout. 23 a user-defined timeout.
20Maximum timeout is 255 sec. 24 Maximum timeout is 255 sec.
21Get time-left is supported. 25 Get time-left is supported.
22 26
23Type 1 HW watchdog implementation exist in old systems and 27Type 1 HW watchdog implementation exist in old systems and
24all new systems have type 2 HW watchdog. 28all new systems have type 2 HW watchdog.
diff --git a/Documentation/watchdog/pcwd-watchdog.txt b/Documentation/watchdog/pcwd-watchdog.rst
index b8e60a441a43..405e2a370082 100644
--- a/Documentation/watchdog/pcwd-watchdog.txt
+++ b/Documentation/watchdog/pcwd-watchdog.rst
@@ -1,8 +1,13 @@
1===================================
2Berkshire Products PC Watchdog Card
3===================================
4
1Last reviewed: 10/05/2007 5Last reviewed: 10/05/2007
2 6
3 Berkshire Products PC Watchdog Card 7Support for ISA Cards Revision A and C
4 Support for ISA Cards Revision A and C 8=======================================
5 Documentation and Driver by Ken Hollis <kenji@bitgate.com> 9
10Documentation and Driver by Ken Hollis <kenji@bitgate.com>
6 11
7 The PC Watchdog is a card that offers the same type of functionality that 12 The PC Watchdog is a card that offers the same type of functionality that
8 the WDT card does, only it doesn't require an IRQ to run. Furthermore, 13 the WDT card does, only it doesn't require an IRQ to run. Furthermore,
@@ -33,6 +38,7 @@ Last reviewed: 10/05/2007
33 WDIOC_GETSUPPORT 38 WDIOC_GETSUPPORT
34 This returns the support of the card itself. This 39 This returns the support of the card itself. This
35 returns in structure "PCWDS" which returns: 40 returns in structure "PCWDS" which returns:
41
36 options = WDIOS_TEMPPANIC 42 options = WDIOS_TEMPPANIC
37 (This card supports temperature) 43 (This card supports temperature)
38 firmware_version = xxxx 44 firmware_version = xxxx
@@ -63,4 +69,3 @@ Last reviewed: 10/05/2007
63 69
64 -- Ken Hollis 70 -- Ken Hollis
65 (kenji@bitgate.com) 71 (kenji@bitgate.com)
66
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.rst
index 0e62ba33b7fb..c6c1e9fa9f73 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.rst
@@ -1,7 +1,10 @@
1=============================
2The Linux Watchdog driver API
3=============================
4
1Last reviewed: 10/05/2007 5Last reviewed: 10/05/2007
2 6
3 7
4The Linux Watchdog driver API.
5 8
6Copyright 2002 Christer Weingel <wingel@nano-system.com> 9Copyright 2002 Christer Weingel <wingel@nano-system.com>
7 10
@@ -10,7 +13,8 @@ driver which is (c) Copyright 2000 Jakob Oestergaard <jakob@ostenfeld.dk>
10 13
11This document describes the state of the Linux 2.4.18 kernel. 14This document describes the state of the Linux 2.4.18 kernel.
12 15
13Introduction: 16Introduction
17============
14 18
15A Watchdog Timer (WDT) is a hardware circuit that can reset the 19A Watchdog Timer (WDT) is a hardware circuit that can reset the
16computer system in case of a software fault. You probably knew that 20computer system in case of a software fault. You probably knew that
@@ -30,7 +34,8 @@ drivers implement different, and sometimes incompatible, parts of it.
30This file is an attempt to document the existing usage and allow 34This file is an attempt to document the existing usage and allow
31future driver writers to use it as a reference. 35future driver writers to use it as a reference.
32 36
33The simplest API: 37The simplest API
38================
34 39
35All drivers support the basic mode of operation, where the watchdog 40All drivers support the basic mode of operation, where the watchdog
36activates as soon as /dev/watchdog is opened and will reboot unless 41activates as soon as /dev/watchdog is opened and will reboot unless
@@ -54,7 +59,8 @@ after the timeout has passed. Watchdog devices also usually support
54the nowayout module parameter so that this option can be controlled at 59the nowayout module parameter so that this option can be controlled at
55runtime. 60runtime.
56 61
57Magic Close feature: 62Magic Close feature
63===================
58 64
59If a driver supports "Magic Close", the driver will not disable the 65If a driver supports "Magic Close", the driver will not disable the
60watchdog unless a specific magic character 'V' has been sent to 66watchdog unless a specific magic character 'V' has been sent to
@@ -64,7 +70,8 @@ will assume that the daemon (and userspace in general) died, and will
64stop pinging the watchdog without disabling it first. This will then 70stop pinging the watchdog without disabling it first. This will then
65cause a reboot if the watchdog is not re-opened in sufficient time. 71cause a reboot if the watchdog is not re-opened in sufficient time.
66 72
67The ioctl API: 73The ioctl API
74=============
68 75
69All conforming drivers also support an ioctl API. 76All conforming drivers also support an ioctl API.
70 77
@@ -73,7 +80,7 @@ Pinging the watchdog using an ioctl:
73All drivers that have an ioctl interface support at least one ioctl, 80All drivers that have an ioctl interface support at least one ioctl,
74KEEPALIVE. This ioctl does exactly the same thing as a write to the 81KEEPALIVE. This ioctl does exactly the same thing as a write to the
75watchdog device, so the main loop in the above program could be 82watchdog device, so the main loop in the above program could be
76replaced with: 83replaced with::
77 84
78 while (1) { 85 while (1) {
79 ioctl(fd, WDIOC_KEEPALIVE, 0); 86 ioctl(fd, WDIOC_KEEPALIVE, 0);
@@ -82,14 +89,15 @@ replaced with:
82 89
83the argument to the ioctl is ignored. 90the argument to the ioctl is ignored.
84 91
85Setting and getting the timeout: 92Setting and getting the timeout
93===============================
86 94
87For some drivers it is possible to modify the watchdog timeout on the 95For some drivers it is possible to modify the watchdog timeout on the
88fly with the SETTIMEOUT ioctl, those drivers have the WDIOF_SETTIMEOUT 96fly with the SETTIMEOUT ioctl, those drivers have the WDIOF_SETTIMEOUT
89flag set in their option field. The argument is an integer 97flag set in their option field. The argument is an integer
90representing the timeout in seconds. The driver returns the real 98representing the timeout in seconds. The driver returns the real
91timeout used in the same variable, and this timeout might differ from 99timeout used in the same variable, and this timeout might differ from
92the requested one due to limitation of the hardware. 100the requested one due to limitation of the hardware::
93 101
94 int timeout = 45; 102 int timeout = 45;
95 ioctl(fd, WDIOC_SETTIMEOUT, &timeout); 103 ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
@@ -99,18 +107,19 @@ This example might actually print "The timeout was set to 60 seconds"
99if the device has a granularity of minutes for its timeout. 107if the device has a granularity of minutes for its timeout.
100 108
101Starting with the Linux 2.4.18 kernel, it is possible to query the 109Starting with the Linux 2.4.18 kernel, it is possible to query the
102current timeout using the GETTIMEOUT ioctl. 110current timeout using the GETTIMEOUT ioctl::
103 111
104 ioctl(fd, WDIOC_GETTIMEOUT, &timeout); 112 ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
105 printf("The timeout was is %d seconds\n", timeout); 113 printf("The timeout was is %d seconds\n", timeout);
106 114
107Pretimeouts: 115Pretimeouts
116===========
108 117
109Some watchdog timers can be set to have a trigger go off before the 118Some watchdog timers can be set to have a trigger go off before the
110actual time they will reset the system. This can be done with an NMI, 119actual time they will reset the system. This can be done with an NMI,
111interrupt, or other mechanism. This allows Linux to record useful 120interrupt, or other mechanism. This allows Linux to record useful
112information (like panic information and kernel coredumps) before it 121information (like panic information and kernel coredumps) before it
113resets. 122resets::
114 123
115 pretimeout = 10; 124 pretimeout = 10;
116 ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout); 125 ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout);
@@ -121,89 +130,113 @@ the pretimeout. So, for instance, if you set the timeout to 60 seconds
121and the pretimeout to 10 seconds, the pretimeout will go off in 50 130and the pretimeout to 10 seconds, the pretimeout will go off in 50
122seconds. Setting a pretimeout to zero disables it. 131seconds. Setting a pretimeout to zero disables it.
123 132
124There is also a get function for getting the pretimeout: 133There is also a get function for getting the pretimeout::
125 134
126 ioctl(fd, WDIOC_GETPRETIMEOUT, &timeout); 135 ioctl(fd, WDIOC_GETPRETIMEOUT, &timeout);
127 printf("The pretimeout was is %d seconds\n", timeout); 136 printf("The pretimeout was is %d seconds\n", timeout);
128 137
129Not all watchdog drivers will support a pretimeout. 138Not all watchdog drivers will support a pretimeout.
130 139
131Get the number of seconds before reboot: 140Get the number of seconds before reboot
141=======================================
132 142
133Some watchdog drivers have the ability to report the remaining time 143Some watchdog drivers have the ability to report the remaining time
134before the system will reboot. The WDIOC_GETTIMELEFT is the ioctl 144before the system will reboot. The WDIOC_GETTIMELEFT is the ioctl
135that returns the number of seconds before reboot. 145that returns the number of seconds before reboot::
136 146
137 ioctl(fd, WDIOC_GETTIMELEFT, &timeleft); 147 ioctl(fd, WDIOC_GETTIMELEFT, &timeleft);
138 printf("The timeout was is %d seconds\n", timeleft); 148 printf("The timeout was is %d seconds\n", timeleft);
139 149
140Environmental monitoring: 150Environmental monitoring
151========================
141 152
142All watchdog drivers are required return more information about the system, 153All watchdog drivers are required return more information about the system,
143some do temperature, fan and power level monitoring, some can tell you 154some do temperature, fan and power level monitoring, some can tell you
144the reason for the last reboot of the system. The GETSUPPORT ioctl is 155the reason for the last reboot of the system. The GETSUPPORT ioctl is
145available to ask what the device can do: 156available to ask what the device can do::
146 157
147 struct watchdog_info ident; 158 struct watchdog_info ident;
148 ioctl(fd, WDIOC_GETSUPPORT, &ident); 159 ioctl(fd, WDIOC_GETSUPPORT, &ident);
149 160
150the fields returned in the ident struct are: 161the fields returned in the ident struct are:
151 162
163 ================ =============================================
152 identity a string identifying the watchdog driver 164 identity a string identifying the watchdog driver
153 firmware_version the firmware version of the card if available 165 firmware_version the firmware version of the card if available
154 options a flags describing what the device supports 166 options a flags describing what the device supports
167 ================ =============================================
155 168
156the options field can have the following bits set, and describes what 169the options field can have the following bits set, and describes what
157kind of information that the GET_STATUS and GET_BOOT_STATUS ioctls can 170kind of information that the GET_STATUS and GET_BOOT_STATUS ioctls can
158return. [FIXME -- Is this correct?] 171return. [FIXME -- Is this correct?]
159 172
173 ================ =========================
160 WDIOF_OVERHEAT Reset due to CPU overheat 174 WDIOF_OVERHEAT Reset due to CPU overheat
175 ================ =========================
161 176
162The machine was last rebooted by the watchdog because the thermal limit was 177The machine was last rebooted by the watchdog because the thermal limit was
163exceeded 178exceeded:
164 179
180 ============== ==========
165 WDIOF_FANFAULT Fan failed 181 WDIOF_FANFAULT Fan failed
182 ============== ==========
166 183
167A system fan monitored by the watchdog card has failed 184A system fan monitored by the watchdog card has failed
168 185
186 ============= ================
169 WDIOF_EXTERN1 External relay 1 187 WDIOF_EXTERN1 External relay 1
188 ============= ================
170 189
171External monitoring relay/source 1 was triggered. Controllers intended for 190External monitoring relay/source 1 was triggered. Controllers intended for
172real world applications include external monitoring pins that will trigger 191real world applications include external monitoring pins that will trigger
173a reset. 192a reset.
174 193
194 ============= ================
175 WDIOF_EXTERN2 External relay 2 195 WDIOF_EXTERN2 External relay 2
196 ============= ================
176 197
177External monitoring relay/source 2 was triggered 198External monitoring relay/source 2 was triggered
178 199
200 ================ =====================
179 WDIOF_POWERUNDER Power bad/power fault 201 WDIOF_POWERUNDER Power bad/power fault
202 ================ =====================
180 203
181The machine is showing an undervoltage status 204The machine is showing an undervoltage status
182 205
206 =============== =============================
183 WDIOF_CARDRESET Card previously reset the CPU 207 WDIOF_CARDRESET Card previously reset the CPU
208 =============== =============================
184 209
185The last reboot was caused by the watchdog card 210The last reboot was caused by the watchdog card
186 211
212 ================ =====================
187 WDIOF_POWEROVER Power over voltage 213 WDIOF_POWEROVER Power over voltage
214 ================ =====================
188 215
189The machine is showing an overvoltage status. Note that if one level is 216The machine is showing an overvoltage status. Note that if one level is
190under and one over both bits will be set - this may seem odd but makes 217under and one over both bits will be set - this may seem odd but makes
191sense. 218sense.
192 219
220 =================== =====================
193 WDIOF_KEEPALIVEPING Keep alive ping reply 221 WDIOF_KEEPALIVEPING Keep alive ping reply
222 =================== =====================
194 223
195The watchdog saw a keepalive ping since it was last queried. 224The watchdog saw a keepalive ping since it was last queried.
196 225
226 ================ =======================
197 WDIOF_SETTIMEOUT Can set/get the timeout 227 WDIOF_SETTIMEOUT Can set/get the timeout
228 ================ =======================
198 229
199The watchdog can do pretimeouts. 230The watchdog can do pretimeouts.
200 231
232 ================ ================================
201 WDIOF_PRETIMEOUT Pretimeout (in seconds), get/set 233 WDIOF_PRETIMEOUT Pretimeout (in seconds), get/set
234 ================ ================================
202 235
203 236
204For those drivers that return any bits set in the option field, the 237For those drivers that return any bits set in the option field, the
205GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current 238GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current
206status, and the status at the last reboot, respectively. 239status, and the status at the last reboot, respectively::
207 240
208 int flags; 241 int flags;
209 ioctl(fd, WDIOC_GETSTATUS, &flags); 242 ioctl(fd, WDIOC_GETSTATUS, &flags);
@@ -216,22 +249,23 @@ Note that not all devices support these two calls, and some only
216support the GETBOOTSTATUS call. 249support the GETBOOTSTATUS call.
217 250
218Some drivers can measure the temperature using the GETTEMP ioctl. The 251Some drivers can measure the temperature using the GETTEMP ioctl. The
219returned value is the temperature in degrees fahrenheit. 252returned value is the temperature in degrees fahrenheit::
220 253
221 int temperature; 254 int temperature;
222 ioctl(fd, WDIOC_GETTEMP, &temperature); 255 ioctl(fd, WDIOC_GETTEMP, &temperature);
223 256
224Finally the SETOPTIONS ioctl can be used to control some aspects of 257Finally the SETOPTIONS ioctl can be used to control some aspects of
225the cards operation. 258the cards operation::
226 259
227 int options = 0; 260 int options = 0;
228 ioctl(fd, WDIOC_SETOPTIONS, &options); 261 ioctl(fd, WDIOC_SETOPTIONS, &options);
229 262
230The following options are available: 263The following options are available:
231 264
265 ================= ================================
232 WDIOS_DISABLECARD Turn off the watchdog timer 266 WDIOS_DISABLECARD Turn off the watchdog timer
233 WDIOS_ENABLECARD Turn on the watchdog timer 267 WDIOS_ENABLECARD Turn on the watchdog timer
234 WDIOS_TEMPPANIC Kernel panic on temperature trip 268 WDIOS_TEMPPANIC Kernel panic on temperature trip
269 ================= ================================
235 270
236[FIXME -- better explanations] 271[FIXME -- better explanations]
237
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.rst
index 3a91ef5af044..864edbe932c1 100644
--- a/Documentation/watchdog/watchdog-kernel-api.txt
+++ b/Documentation/watchdog/watchdog-kernel-api.rst
@@ -1,5 +1,7 @@
1The Linux WatchDog Timer Driver Core kernel API.
2=============================================== 1===============================================
2The Linux WatchDog Timer Driver Core kernel API
3===============================================
4
3Last reviewed: 12-Feb-2013 5Last reviewed: 12-Feb-2013
4 6
5Wim Van Sebroeck <wim@iguana.be> 7Wim Van Sebroeck <wim@iguana.be>
@@ -9,7 +11,7 @@ Introduction
9This document does not describe what a WatchDog Timer (WDT) Driver or Device is. 11This document does not describe what a WatchDog Timer (WDT) Driver or Device is.
10It also does not describe the API which can be used by user space to communicate 12It also does not describe the API which can be used by user space to communicate
11with a WatchDog Timer. If you want to know this then please read the following 13with a WatchDog Timer. If you want to know this then please read the following
12file: Documentation/watchdog/watchdog-api.txt . 14file: Documentation/watchdog/watchdog-api.rst .
13 15
14So what does this document describe? It describes the API that can be used by 16So what does this document describe? It describes the API that can be used by
15WatchDog Timer Drivers that want to use the WatchDog Timer Driver Core 17WatchDog Timer Drivers that want to use the WatchDog Timer Driver Core
@@ -23,10 +25,10 @@ The API
23Each watchdog timer driver that wants to use the WatchDog Timer Driver Core 25Each watchdog timer driver that wants to use the WatchDog Timer Driver Core
24must #include <linux/watchdog.h> (you would have to do this anyway when 26must #include <linux/watchdog.h> (you would have to do this anyway when
25writing a watchdog device driver). This include file contains following 27writing a watchdog device driver). This include file contains following
26register/unregister routines: 28register/unregister routines::
27 29
28extern int watchdog_register_device(struct watchdog_device *); 30 extern int watchdog_register_device(struct watchdog_device *);
29extern void watchdog_unregister_device(struct watchdog_device *); 31 extern void watchdog_unregister_device(struct watchdog_device *);
30 32
31The watchdog_register_device routine registers a watchdog timer device. 33The watchdog_register_device routine registers a watchdog timer device.
32The parameter of this routine is a pointer to a watchdog_device structure. 34The parameter of this routine is a pointer to a watchdog_device structure.
@@ -40,9 +42,9 @@ The watchdog subsystem includes an registration deferral mechanism,
40which allows you to register an watchdog as early as you wish during 42which allows you to register an watchdog as early as you wish during
41the boot process. 43the boot process.
42 44
43The watchdog device structure looks like this: 45The watchdog device structure looks like this::
44 46
45struct watchdog_device { 47 struct watchdog_device {
46 int id; 48 int id;
47 struct device *parent; 49 struct device *parent;
48 const struct attribute_group **groups; 50 const struct attribute_group **groups;
@@ -62,9 +64,10 @@ struct watchdog_device {
62 struct watchdog_core_data *wd_data; 64 struct watchdog_core_data *wd_data;
63 unsigned long status; 65 unsigned long status;
64 struct list_head deferred; 66 struct list_head deferred;
65}; 67 };
66 68
67It contains following fields: 69It contains following fields:
70
68* id: set by watchdog_register_device, id 0 is special. It has both a 71* id: set by watchdog_register_device, id 0 is special. It has both a
69 /dev/watchdog0 cdev (dynamic major, minor 0) as well as the old 72 /dev/watchdog0 cdev (dynamic major, minor 0) as well as the old
70 /dev/watchdog miscdev. The id is set automatically when calling 73 /dev/watchdog miscdev. The id is set automatically when calling
@@ -114,9 +117,9 @@ It contains following fields:
114* deferred: entry in wtd_deferred_reg_list which is used to 117* deferred: entry in wtd_deferred_reg_list which is used to
115 register early initialized watchdogs. 118 register early initialized watchdogs.
116 119
117The list of watchdog operations is defined as: 120The list of watchdog operations is defined as::
118 121
119struct watchdog_ops { 122 struct watchdog_ops {
120 struct module *owner; 123 struct module *owner;
121 /* mandatory operations */ 124 /* mandatory operations */
122 int (*start)(struct watchdog_device *); 125 int (*start)(struct watchdog_device *);
@@ -129,7 +132,7 @@ struct watchdog_ops {
129 unsigned int (*get_timeleft)(struct watchdog_device *); 132 unsigned int (*get_timeleft)(struct watchdog_device *);
130 int (*restart)(struct watchdog_device *); 133 int (*restart)(struct watchdog_device *);
131 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); 134 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
132}; 135 };
133 136
134It is important that you first define the module owner of the watchdog timer 137It is important that you first define the module owner of the watchdog timer
135driver's operations. This module owner will be used to lock the module when 138driver's operations. This module owner will be used to lock the module when
@@ -138,6 +141,7 @@ module and /dev/watchdog is still open).
138 141
139Some operations are mandatory and some are optional. The mandatory operations 142Some operations are mandatory and some are optional. The mandatory operations
140are: 143are:
144
141* start: this is a pointer to the routine that starts the watchdog timer 145* start: this is a pointer to the routine that starts the watchdog timer
142 device. 146 device.
143 The routine needs a pointer to the watchdog timer device structure as a 147 The routine needs a pointer to the watchdog timer device structure as a
@@ -146,51 +150,64 @@ are:
146Not all watchdog timer hardware supports the same functionality. That's why 150Not all watchdog timer hardware supports the same functionality. That's why
147all other routines/operations are optional. They only need to be provided if 151all other routines/operations are optional. They only need to be provided if
148they are supported. These optional routines/operations are: 152they are supported. These optional routines/operations are:
153
149* stop: with this routine the watchdog timer device is being stopped. 154* stop: with this routine the watchdog timer device is being stopped.
155
150 The routine needs a pointer to the watchdog timer device structure as a 156 The routine needs a pointer to the watchdog timer device structure as a
151 parameter. It returns zero on success or a negative errno code for failure. 157 parameter. It returns zero on success or a negative errno code for failure.
152 Some watchdog timer hardware can only be started and not be stopped. A 158 Some watchdog timer hardware can only be started and not be stopped. A
153 driver supporting such hardware does not have to implement the stop routine. 159 driver supporting such hardware does not have to implement the stop routine.
160
154 If a driver has no stop function, the watchdog core will set WDOG_HW_RUNNING 161 If a driver has no stop function, the watchdog core will set WDOG_HW_RUNNING
155 and start calling the driver's keepalive pings function after the watchdog 162 and start calling the driver's keepalive pings function after the watchdog
156 device is closed. 163 device is closed.
164
157 If a watchdog driver does not implement the stop function, it must set 165 If a watchdog driver does not implement the stop function, it must set
158 max_hw_heartbeat_ms. 166 max_hw_heartbeat_ms.
159* ping: this is the routine that sends a keepalive ping to the watchdog timer 167* ping: this is the routine that sends a keepalive ping to the watchdog timer
160 hardware. 168 hardware.
169
161 The routine needs a pointer to the watchdog timer device structure as a 170 The routine needs a pointer to the watchdog timer device structure as a
162 parameter. It returns zero on success or a negative errno code for failure. 171 parameter. It returns zero on success or a negative errno code for failure.
172
163 Most hardware that does not support this as a separate function uses the 173 Most hardware that does not support this as a separate function uses the
164 start function to restart the watchdog timer hardware. And that's also what 174 start function to restart the watchdog timer hardware. And that's also what
165 the watchdog timer driver core does: to send a keepalive ping to the watchdog 175 the watchdog timer driver core does: to send a keepalive ping to the watchdog
166 timer hardware it will either use the ping operation (when available) or the 176 timer hardware it will either use the ping operation (when available) or the
167 start operation (when the ping operation is not available). 177 start operation (when the ping operation is not available).
178
168 (Note: the WDIOC_KEEPALIVE ioctl call will only be active when the 179 (Note: the WDIOC_KEEPALIVE ioctl call will only be active when the
169 WDIOF_KEEPALIVEPING bit has been set in the option field on the watchdog's 180 WDIOF_KEEPALIVEPING bit has been set in the option field on the watchdog's
170 info structure). 181 info structure).
171* status: this routine checks the status of the watchdog timer device. The 182* status: this routine checks the status of the watchdog timer device. The
172 status of the device is reported with watchdog WDIOF_* status flags/bits. 183 status of the device is reported with watchdog WDIOF_* status flags/bits.
184
173 WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING are reported by the watchdog core; 185 WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING are reported by the watchdog core;
174 it is not necessary to report those bits from the driver. Also, if no status 186 it is not necessary to report those bits from the driver. Also, if no status
175 function is provided by the driver, the watchdog core reports the status bits 187 function is provided by the driver, the watchdog core reports the status bits
176 provided in the bootstatus variable of struct watchdog_device. 188 provided in the bootstatus variable of struct watchdog_device.
189
177* set_timeout: this routine checks and changes the timeout of the watchdog 190* set_timeout: this routine checks and changes the timeout of the watchdog
178 timer device. It returns 0 on success, -EINVAL for "parameter out of range" 191 timer device. It returns 0 on success, -EINVAL for "parameter out of range"
179 and -EIO for "could not write value to the watchdog". On success this 192 and -EIO for "could not write value to the watchdog". On success this
180 routine should set the timeout value of the watchdog_device to the 193 routine should set the timeout value of the watchdog_device to the
181 achieved timeout value (which may be different from the requested one 194 achieved timeout value (which may be different from the requested one
182 because the watchdog does not necessarily have a 1 second resolution). 195 because the watchdog does not necessarily have a 1 second resolution).
196
183 Drivers implementing max_hw_heartbeat_ms set the hardware watchdog heartbeat 197 Drivers implementing max_hw_heartbeat_ms set the hardware watchdog heartbeat
184 to the minimum of timeout and max_hw_heartbeat_ms. Those drivers set the 198 to the minimum of timeout and max_hw_heartbeat_ms. Those drivers set the
185 timeout value of the watchdog_device either to the requested timeout value 199 timeout value of the watchdog_device either to the requested timeout value
186 (if it is larger than max_hw_heartbeat_ms), or to the achieved timeout value. 200 (if it is larger than max_hw_heartbeat_ms), or to the achieved timeout value.
187 (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the 201 (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
188 watchdog's info structure). 202 watchdog's info structure).
203
189 If the watchdog driver does not have to perform any action but setting the 204 If the watchdog driver does not have to perform any action but setting the
190 watchdog_device.timeout, this callback can be omitted. 205 watchdog_device.timeout, this callback can be omitted.
206
191 If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog 207 If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog
192 infrastructure updates the timeout value of the watchdog_device internally 208 infrastructure updates the timeout value of the watchdog_device internally
193 to the requested value. 209 to the requested value.
210
194 If the pretimeout feature is used (WDIOF_PRETIMEOUT), then set_timeout must 211 If the pretimeout feature is used (WDIOF_PRETIMEOUT), then set_timeout must
195 also take care of checking if pretimeout is still valid and set up the timer 212 also take care of checking if pretimeout is still valid and set up the timer
196 accordingly. This can't be done in the core without races, so it is the 213 accordingly. This can't be done in the core without races, so it is the
@@ -201,13 +218,16 @@ they are supported. These optional routines/operations are:
201 seconds before the actual timeout would happen. It returns 0 on success, 218 seconds before the actual timeout would happen. It returns 0 on success,
202 -EINVAL for "parameter out of range" and -EIO for "could not write value to 219 -EINVAL for "parameter out of range" and -EIO for "could not write value to
203 the watchdog". A value of 0 disables pretimeout notification. 220 the watchdog". A value of 0 disables pretimeout notification.
221
204 (Note: the WDIOF_PRETIMEOUT needs to be set in the options field of the 222 (Note: the WDIOF_PRETIMEOUT needs to be set in the options field of the
205 watchdog's info structure). 223 watchdog's info structure).
224
206 If the watchdog driver does not have to perform any action but setting the 225 If the watchdog driver does not have to perform any action but setting the
207 watchdog_device.pretimeout, this callback can be omitted. That means if 226 watchdog_device.pretimeout, this callback can be omitted. That means if
208 set_pretimeout is not provided but WDIOF_PRETIMEOUT is set, the watchdog 227 set_pretimeout is not provided but WDIOF_PRETIMEOUT is set, the watchdog
209 infrastructure updates the pretimeout value of the watchdog_device internally 228 infrastructure updates the pretimeout value of the watchdog_device internally
210 to the requested value. 229 to the requested value.
230
211* get_timeleft: this routines returns the time that's left before a reset. 231* get_timeleft: this routines returns the time that's left before a reset.
212* restart: this routine restarts the machine. It returns 0 on success or a 232* restart: this routine restarts the machine. It returns 0 on success or a
213 negative errno code for failure. 233 negative errno code for failure.
@@ -218,6 +238,7 @@ they are supported. These optional routines/operations are:
218 238
219The status bits should (preferably) be set with the set_bit and clear_bit alike 239The status bits should (preferably) be set with the set_bit and clear_bit alike
220bit-operations. The status bits that are defined are: 240bit-operations. The status bits that are defined are:
241
221* WDOG_ACTIVE: this status bit indicates whether or not a watchdog timer device 242* WDOG_ACTIVE: this status bit indicates whether or not a watchdog timer device
222 is active or not from user perspective. User space is expected to send 243 is active or not from user perspective. User space is expected to send
223 heartbeat requests to the driver while this flag is set. 244 heartbeat requests to the driver while this flag is set.
@@ -235,22 +256,30 @@ bit-operations. The status bits that are defined are:
235 256
236 To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog 257 To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog
237 timer device) you can either: 258 timer device) you can either:
259
238 * set it statically in your watchdog_device struct with 260 * set it statically in your watchdog_device struct with
261
239 .status = WATCHDOG_NOWAYOUT_INIT_STATUS, 262 .status = WATCHDOG_NOWAYOUT_INIT_STATUS,
263
240 (this will set the value the same as CONFIG_WATCHDOG_NOWAYOUT) or 264 (this will set the value the same as CONFIG_WATCHDOG_NOWAYOUT) or
241 * use the following helper function: 265 * use the following helper function::
242 static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout) 266
267 static inline void watchdog_set_nowayout(struct watchdog_device *wdd,
268 int nowayout)
269
270Note:
271 The WatchDog Timer Driver Core supports the magic close feature and
272 the nowayout feature. To use the magic close feature you must set the
273 WDIOF_MAGICCLOSE bit in the options field of the watchdog's info structure.
243 274
244Note: The WatchDog Timer Driver Core supports the magic close feature and
245the nowayout feature. To use the magic close feature you must set the
246WDIOF_MAGICCLOSE bit in the options field of the watchdog's info structure.
247The nowayout feature will overrule the magic close feature. 275The nowayout feature will overrule the magic close feature.
248 276
249To get or set driver specific data the following two helper functions should be 277To get or set driver specific data the following two helper functions should be
250used: 278used::
251 279
252static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) 280 static inline void watchdog_set_drvdata(struct watchdog_device *wdd,
253static inline void *watchdog_get_drvdata(struct watchdog_device *wdd) 281 void *data)
282 static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
254 283
255The watchdog_set_drvdata function allows you to add driver specific data. The 284The watchdog_set_drvdata function allows you to add driver specific data. The
256arguments of this function are the watchdog device where you want to add the 285arguments of this function are the watchdog device where you want to add the
@@ -260,10 +289,11 @@ The watchdog_get_drvdata function allows you to retrieve driver specific data.
260The argument of this function is the watchdog device where you want to retrieve 289The argument of this function is the watchdog device where you want to retrieve
261data from. The function returns the pointer to the driver specific data. 290data from. The function returns the pointer to the driver specific data.
262 291
263To initialize the timeout field, the following function can be used: 292To initialize the timeout field, the following function can be used::
264 293
265extern int watchdog_init_timeout(struct watchdog_device *wdd, 294 extern int watchdog_init_timeout(struct watchdog_device *wdd,
266 unsigned int timeout_parm, struct device *dev); 295 unsigned int timeout_parm,
296 struct device *dev);
267 297
268The watchdog_init_timeout function allows you to initialize the timeout field 298The watchdog_init_timeout function allows you to initialize the timeout field
269using the module timeout parameter or by retrieving the timeout-sec property from 299using the module timeout parameter or by retrieving the timeout-sec property from
@@ -272,30 +302,33 @@ to set the default timeout value as timeout value in the watchdog_device and
272then use this function to set the user "preferred" timeout value. 302then use this function to set the user "preferred" timeout value.
273This routine returns zero on success and a negative errno code for failure. 303This routine returns zero on success and a negative errno code for failure.
274 304
275To disable the watchdog on reboot, the user must call the following helper: 305To disable the watchdog on reboot, the user must call the following helper::
276 306
277static inline void watchdog_stop_on_reboot(struct watchdog_device *wdd); 307 static inline void watchdog_stop_on_reboot(struct watchdog_device *wdd);
278 308
279To disable the watchdog when unregistering the watchdog, the user must call 309To disable the watchdog when unregistering the watchdog, the user must call
280the following helper. Note that this will only stop the watchdog if the 310the following helper. Note that this will only stop the watchdog if the
281nowayout flag is not set. 311nowayout flag is not set.
282 312
283static inline void watchdog_stop_on_unregister(struct watchdog_device *wdd); 313::
314
315 static inline void watchdog_stop_on_unregister(struct watchdog_device *wdd);
284 316
285To change the priority of the restart handler the following helper should be 317To change the priority of the restart handler the following helper should be
286used: 318used::
287 319
288void watchdog_set_restart_priority(struct watchdog_device *wdd, int priority); 320 void watchdog_set_restart_priority(struct watchdog_device *wdd, int priority);
289 321
290User should follow the following guidelines for setting the priority: 322User should follow the following guidelines for setting the priority:
323
291* 0: should be called in last resort, has limited restart capabilities 324* 0: should be called in last resort, has limited restart capabilities
292* 128: default restart handler, use if no other handler is expected to be 325* 128: default restart handler, use if no other handler is expected to be
293 available, and/or if restart is sufficient to restart the entire system 326 available, and/or if restart is sufficient to restart the entire system
294* 255: highest priority, will preempt all other restart handlers 327* 255: highest priority, will preempt all other restart handlers
295 328
296To raise a pretimeout notification, the following function should be used: 329To raise a pretimeout notification, the following function should be used::
297 330
298void watchdog_notify_pretimeout(struct watchdog_device *wdd) 331 void watchdog_notify_pretimeout(struct watchdog_device *wdd)
299 332
300The function can be called in the interrupt context. If watchdog pretimeout 333The function can be called in the interrupt context. If watchdog pretimeout
301governor framework (kbuild CONFIG_WATCHDOG_PRETIMEOUT_GOV symbol) is enabled, 334governor framework (kbuild CONFIG_WATCHDOG_PRETIMEOUT_GOV symbol) is enabled,
diff --git a/Documentation/watchdog/watchdog-parameters.rst b/Documentation/watchdog/watchdog-parameters.rst
new file mode 100644
index 000000000000..b121caae7798
--- /dev/null
+++ b/Documentation/watchdog/watchdog-parameters.rst
@@ -0,0 +1,736 @@
1==========================
2WatchDog Module Parameters
3==========================
4
5This file provides information on the module parameters of many of
6the Linux watchdog drivers. Watchdog driver parameter specs should
7be listed here unless the driver has its own driver-specific information
8file.
9
10See Documentation/admin-guide/kernel-parameters.rst for information on
11providing kernel parameters for builtin drivers versus loadable
12modules.
13
14-------------------------------------------------
15
16acquirewdt:
17 wdt_stop:
18 Acquire WDT 'stop' io port (default 0x43)
19 wdt_start:
20 Acquire WDT 'start' io port (default 0x443)
21 nowayout:
22 Watchdog cannot be stopped once started
23 (default=kernel config parameter)
24
25-------------------------------------------------
26
27advantechwdt:
28 wdt_stop:
29 Advantech WDT 'stop' io port (default 0x443)
30 wdt_start:
31 Advantech WDT 'start' io port (default 0x443)
32 timeout:
33 Watchdog timeout in seconds. 1<= timeout <=63, default=60.
34 nowayout:
35 Watchdog cannot be stopped once started
36 (default=kernel config parameter)
37
38-------------------------------------------------
39
40alim1535_wdt:
41 timeout:
42 Watchdog timeout in seconds. (0 < timeout < 18000, default=60
43 nowayout:
44 Watchdog cannot be stopped once started
45 (default=kernel config parameter)
46
47-------------------------------------------------
48
49alim7101_wdt:
50 timeout:
51 Watchdog timeout in seconds. (1<=timeout<=3600, default=30
52 use_gpio:
53 Use the gpio watchdog (required by old cobalt boards).
54 default=0/off/no
55 nowayout:
56 Watchdog cannot be stopped once started
57 (default=kernel config parameter)
58
59-------------------------------------------------
60
61ar7_wdt:
62 margin:
63 Watchdog margin in seconds (default=60)
64 nowayout:
65 Disable watchdog shutdown on close
66 (default=kernel config parameter)
67
68-------------------------------------------------
69
70armada_37xx_wdt:
71 timeout:
72 Watchdog timeout in seconds. (default=120)
73 nowayout:
74 Disable watchdog shutdown on close
75 (default=kernel config parameter)
76
77-------------------------------------------------
78
79at91rm9200_wdt:
80 wdt_time:
81 Watchdog time in seconds. (default=5)
82 nowayout:
83 Watchdog cannot be stopped once started
84 (default=kernel config parameter)
85
86-------------------------------------------------
87
88at91sam9_wdt:
89 heartbeat:
90 Watchdog heartbeats in seconds. (default = 15)
91 nowayout:
92 Watchdog cannot be stopped once started
93 (default=kernel config parameter)
94
95-------------------------------------------------
96
97bcm47xx_wdt:
98 wdt_time:
99 Watchdog time in seconds. (default=30)
100 nowayout:
101 Watchdog cannot be stopped once started
102 (default=kernel config parameter)
103
104-------------------------------------------------
105
106coh901327_wdt:
107 margin:
108 Watchdog margin in seconds (default 60s)
109
110-------------------------------------------------
111
112cpu5wdt:
113 port:
114 base address of watchdog card, default is 0x91
115 verbose:
116 be verbose, default is 0 (no)
117 ticks:
118 count down ticks, default is 10000
119
120-------------------------------------------------
121
122cpwd:
123 wd0_timeout:
124 Default watchdog0 timeout in 1/10secs
125 wd1_timeout:
126 Default watchdog1 timeout in 1/10secs
127 wd2_timeout:
128 Default watchdog2 timeout in 1/10secs
129
130-------------------------------------------------
131
132da9052wdt:
133 timeout:
134 Watchdog timeout in seconds. 2<= timeout <=131, default=2.048s
135 nowayout:
136 Watchdog cannot be stopped once started
137 (default=kernel config parameter)
138
139-------------------------------------------------
140
141davinci_wdt:
142 heartbeat:
143 Watchdog heartbeat period in seconds from 1 to 600, default 60
144
145-------------------------------------------------
146
147ebc-c384_wdt:
148 timeout:
149 Watchdog timeout in seconds. (1<=timeout<=15300, default=60)
150 nowayout:
151 Watchdog cannot be stopped once started
152
153-------------------------------------------------
154
155ep93xx_wdt:
156 nowayout:
157 Watchdog cannot be stopped once started
158 timeout:
159 Watchdog timeout in seconds. (1<=timeout<=3600, default=TBD)
160
161-------------------------------------------------
162
163eurotechwdt:
164 nowayout:
165 Watchdog cannot be stopped once started
166 (default=kernel config parameter)
167 io:
168 Eurotech WDT io port (default=0x3f0)
169 irq:
170 Eurotech WDT irq (default=10)
171 ev:
172 Eurotech WDT event type (default is `int`)
173
174-------------------------------------------------
175
176gef_wdt:
177 nowayout:
178 Watchdog cannot be stopped once started
179 (default=kernel config parameter)
180
181-------------------------------------------------
182
183geodewdt:
184 timeout:
185 Watchdog timeout in seconds. 1<= timeout <=131, default=60.
186 nowayout:
187 Watchdog cannot be stopped once started
188 (default=kernel config parameter)
189
190-------------------------------------------------
191
192i6300esb:
193 heartbeat:
194 Watchdog heartbeat in seconds. (1<heartbeat<2046, default=30)
195 nowayout:
196 Watchdog cannot be stopped once started
197 (default=kernel config parameter)
198
199-------------------------------------------------
200
201iTCO_wdt:
202 heartbeat:
203 Watchdog heartbeat in seconds.
204 (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30)
205 nowayout:
206 Watchdog cannot be stopped once started
207 (default=kernel config parameter)
208
209-------------------------------------------------
210
211iTCO_vendor_support:
212 vendorsupport:
213 iTCO vendor specific support mode, default=0 (none),
214 1=SuperMicro Pent3, 2=SuperMicro Pent4+, 911=Broken SMI BIOS
215
216-------------------------------------------------
217
218ib700wdt:
219 timeout:
220 Watchdog timeout in seconds. 0<= timeout <=30, default=30.
221 nowayout:
222 Watchdog cannot be stopped once started
223 (default=kernel config parameter)
224
225-------------------------------------------------
226
227ibmasr:
228 nowayout:
229 Watchdog cannot be stopped once started
230 (default=kernel config parameter)
231
232-------------------------------------------------
233
234imx2_wdt:
235 timeout:
236 Watchdog timeout in seconds (default 60 s)
237 nowayout:
238 Watchdog cannot be stopped once started
239 (default=kernel config parameter)
240
241-------------------------------------------------
242
243indydog:
244 nowayout:
245 Watchdog cannot be stopped once started
246 (default=kernel config parameter)
247
248-------------------------------------------------
249
250iop_wdt:
251 nowayout:
252 Watchdog cannot be stopped once started
253 (default=kernel config parameter)
254
255-------------------------------------------------
256
257it8712f_wdt:
258 margin:
259 Watchdog margin in seconds (default 60)
260 nowayout:
261 Disable watchdog shutdown on close
262 (default=kernel config parameter)
263
264-------------------------------------------------
265
266it87_wdt:
267 nogameport:
268 Forbid the activation of game port, default=0
269 nocir:
270 Forbid the use of CIR (workaround for some buggy setups); set to 1 if
271system resets despite watchdog daemon running, default=0
272 exclusive:
273 Watchdog exclusive device open, default=1
274 timeout:
275 Watchdog timeout in seconds, default=60
276 testmode:
277 Watchdog test mode (1 = no reboot), default=0
278 nowayout:
279 Watchdog cannot be stopped once started
280 (default=kernel config parameter)
281
282-------------------------------------------------
283
284ixp4xx_wdt:
285 heartbeat:
286 Watchdog heartbeat in seconds (default 60s)
287 nowayout:
288 Watchdog cannot be stopped once started
289 (default=kernel config parameter)
290
291-------------------------------------------------
292
293ks8695_wdt:
294 wdt_time:
295 Watchdog time in seconds. (default=5)
296 nowayout:
297 Watchdog cannot be stopped once started
298 (default=kernel config parameter)
299
300-------------------------------------------------
301
302machzwd:
303 nowayout:
304 Watchdog cannot be stopped once started
305 (default=kernel config parameter)
306 action:
307 after watchdog resets, generate:
308 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI
309
310-------------------------------------------------
311
312max63xx_wdt:
313 heartbeat:
314 Watchdog heartbeat period in seconds from 1 to 60, default 60
315 nowayout:
316 Watchdog cannot be stopped once started
317 (default=kernel config parameter)
318 nodelay:
319 Force selection of a timeout setting without initial delay
320 (max6373/74 only, default=0)
321
322-------------------------------------------------
323
324mixcomwd:
325 nowayout:
326 Watchdog cannot be stopped once started
327 (default=kernel config parameter)
328
329-------------------------------------------------
330
331mpc8xxx_wdt:
332 timeout:
333 Watchdog timeout in ticks. (0<timeout<65536, default=65535)
334 reset:
335 Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset
336 nowayout:
337 Watchdog cannot be stopped once started
338 (default=kernel config parameter)
339
340-------------------------------------------------
341
342mv64x60_wdt:
343 nowayout:
344 Watchdog cannot be stopped once started
345 (default=kernel config parameter)
346
347-------------------------------------------------
348
349ni903x_wdt:
350 timeout:
351 Initial watchdog timeout in seconds (0<timeout<516, default=60)
352 nowayout:
353 Watchdog cannot be stopped once started
354 (default=kernel config parameter)
355
356-------------------------------------------------
357
358nic7018_wdt:
359 timeout:
360 Initial watchdog timeout in seconds (0<timeout<464, default=80)
361 nowayout:
362 Watchdog cannot be stopped once started
363 (default=kernel config parameter)
364
365-------------------------------------------------
366
367nuc900_wdt:
368 heartbeat:
369 Watchdog heartbeats in seconds.
370 (default = 15)
371 nowayout:
372 Watchdog cannot be stopped once started
373 (default=kernel config parameter)
374
375-------------------------------------------------
376
377omap_wdt:
378 timer_margin:
379 initial watchdog timeout (in seconds)
380 early_enable:
381 Watchdog is started on module insertion (default=0
382 nowayout:
383 Watchdog cannot be stopped once started
384 (default=kernel config parameter)
385
386-------------------------------------------------
387
388orion_wdt:
389 heartbeat:
390 Initial watchdog heartbeat in seconds
391 nowayout:
392 Watchdog cannot be stopped once started
393 (default=kernel config parameter)
394
395-------------------------------------------------
396
397pc87413_wdt:
398 io:
399 pc87413 WDT I/O port (default: io).
400 timeout:
401 Watchdog timeout in minutes (default=timeout).
402 nowayout:
403 Watchdog cannot be stopped once started
404 (default=kernel config parameter)
405
406-------------------------------------------------
407
408pika_wdt:
409 heartbeat:
410 Watchdog heartbeats in seconds. (default = 15)
411 nowayout:
412 Watchdog cannot be stopped once started
413 (default=kernel config parameter)
414
415-------------------------------------------------
416
417pnx4008_wdt:
418 heartbeat:
419 Watchdog heartbeat period in seconds from 1 to 60, default 19
420 nowayout:
421 Set to 1 to keep watchdog running after device release
422
423-------------------------------------------------
424
425pnx833x_wdt:
426 timeout:
427 Watchdog timeout in Mhz. (68Mhz clock), default=2040000000 (30 seconds)
428 nowayout:
429 Watchdog cannot be stopped once started
430 (default=kernel config parameter)
431 start_enabled:
432 Watchdog is started on module insertion (default=1)
433
434-------------------------------------------------
435
436rc32434_wdt:
437 timeout:
438 Watchdog timeout value, in seconds (default=20)
439 nowayout:
440 Watchdog cannot be stopped once started
441 (default=kernel config parameter)
442
443-------------------------------------------------
444
445riowd:
446 riowd_timeout:
447 Watchdog timeout in minutes (default=1)
448
449-------------------------------------------------
450
451s3c2410_wdt:
452 tmr_margin:
453 Watchdog tmr_margin in seconds. (default=15)
454 tmr_atboot:
455 Watchdog is started at boot time if set to 1, default=0
456 nowayout:
457 Watchdog cannot be stopped once started
458 (default=kernel config parameter)
459 soft_noboot:
460 Watchdog action, set to 1 to ignore reboots, 0 to reboot
461 debug:
462 Watchdog debug, set to >1 for debug, (default 0)
463
464-------------------------------------------------
465
466sa1100_wdt:
467 margin:
468 Watchdog margin in seconds (default 60s)
469
470-------------------------------------------------
471
472sb_wdog:
473 timeout:
474 Watchdog timeout in microseconds (max/default 8388607 or 8.3ish secs)
475
476-------------------------------------------------
477
478sbc60xxwdt:
479 wdt_stop:
480 SBC60xx WDT 'stop' io port (default 0x45)
481 wdt_start:
482 SBC60xx WDT 'start' io port (default 0x443)
483 timeout:
484 Watchdog timeout in seconds. (1<=timeout<=3600, default=30)
485 nowayout:
486 Watchdog cannot be stopped once started
487 (default=kernel config parameter)
488
489-------------------------------------------------
490
491sbc7240_wdt:
492 timeout:
493 Watchdog timeout in seconds. (1<=timeout<=255, default=30)
494 nowayout:
495 Disable watchdog when closing device file
496
497-------------------------------------------------
498
499sbc8360:
500 timeout:
501 Index into timeout table (0-63) (default=27 (60s))
502 nowayout:
503 Watchdog cannot be stopped once started
504 (default=kernel config parameter)
505
506-------------------------------------------------
507
508sbc_epx_c3:
509 nowayout:
510 Watchdog cannot be stopped once started
511 (default=kernel config parameter)
512
513-------------------------------------------------
514
515sbc_fitpc2_wdt:
516 margin:
517 Watchdog margin in seconds (default 60s)
518 nowayout:
519 Watchdog cannot be stopped once started
520
521-------------------------------------------------
522
523sbsa_gwdt:
524 timeout:
525 Watchdog timeout in seconds. (default 10s)
526 action:
527 Watchdog action at the first stage timeout,
528 set to 0 to ignore, 1 to panic. (default=0)
529 nowayout:
530 Watchdog cannot be stopped once started
531 (default=kernel config parameter)
532
533-------------------------------------------------
534
535sc1200wdt:
536 isapnp:
537 When set to 0 driver ISA PnP support will be disabled (default=1)
538 io:
539 io port
540 timeout:
541 range is 0-255 minutes, default is 1
542 nowayout:
543 Watchdog cannot be stopped once started
544 (default=kernel config parameter)
545
546-------------------------------------------------
547
548sc520_wdt:
549 timeout:
550 Watchdog timeout in seconds. (1 <= timeout <= 3600, default=30)
551 nowayout:
552 Watchdog cannot be stopped once started
553 (default=kernel config parameter)
554
555-------------------------------------------------
556
557sch311x_wdt:
558 force_id:
559 Override the detected device ID
560 therm_trip:
561 Should a ThermTrip trigger the reset generator
562 timeout:
563 Watchdog timeout in seconds. 1<= timeout <=15300, default=60
564 nowayout:
565 Watchdog cannot be stopped once started
566 (default=kernel config parameter)
567
568-------------------------------------------------
569
570scx200_wdt:
571 margin:
572 Watchdog margin in seconds
573 nowayout:
574 Disable watchdog shutdown on close
575
576-------------------------------------------------
577
578shwdt:
579 clock_division_ratio:
580 Clock division ratio. Valid ranges are from 0x5 (1.31ms)
581 to 0x7 (5.25ms). (default=7)
582 heartbeat:
583 Watchdog heartbeat in seconds. (1 <= heartbeat <= 3600, default=30
584 nowayout:
585 Watchdog cannot be stopped once started
586 (default=kernel config parameter)
587
588-------------------------------------------------
589
590smsc37b787_wdt:
591 timeout:
592 range is 1-255 units, default is 60
593 nowayout:
594 Watchdog cannot be stopped once started
595 (default=kernel config parameter)
596
597-------------------------------------------------
598
599softdog:
600 soft_margin:
601 Watchdog soft_margin in seconds.
602 (0 < soft_margin < 65536, default=60)
603 nowayout:
604 Watchdog cannot be stopped once started
605 (default=kernel config parameter)
606 soft_noboot:
607 Softdog action, set to 1 to ignore reboots, 0 to reboot
608 (default=0)
609
610-------------------------------------------------
611
612stmp3xxx_wdt:
613 heartbeat:
614 Watchdog heartbeat period in seconds from 1 to 4194304, default 19
615
616-------------------------------------------------
617
618tegra_wdt:
619 heartbeat:
620 Watchdog heartbeats in seconds. (default = 120)
621 nowayout:
622 Watchdog cannot be stopped once started
623 (default=kernel config parameter)
624
625-------------------------------------------------
626
627ts72xx_wdt:
628 timeout:
629 Watchdog timeout in seconds. (1 <= timeout <= 8, default=8)
630 nowayout:
631 Disable watchdog shutdown on close
632
633-------------------------------------------------
634
635twl4030_wdt:
636 nowayout:
637 Watchdog cannot be stopped once started
638 (default=kernel config parameter)
639
640-------------------------------------------------
641
642txx9wdt:
643 timeout:
644 Watchdog timeout in seconds. (0<timeout<N, default=60)
645 nowayout:
646 Watchdog cannot be stopped once started
647 (default=kernel config parameter)
648
649-------------------------------------------------
650
651uniphier_wdt:
652 timeout:
653 Watchdog timeout in power of two seconds.
654 (1 <= timeout <= 128, default=64)
655 nowayout:
656 Watchdog cannot be stopped once started
657 (default=kernel config parameter)
658
659-------------------------------------------------
660
661w83627hf_wdt:
662 wdt_io:
663 w83627hf/thf WDT io port (default 0x2E)
664 timeout:
665 Watchdog timeout in seconds. 1 <= timeout <= 255, default=60.
666 nowayout:
667 Watchdog cannot be stopped once started
668 (default=kernel config parameter)
669
670-------------------------------------------------
671
672w83877f_wdt:
673 timeout:
674 Watchdog timeout in seconds. (1<=timeout<=3600, default=30)
675 nowayout:
676 Watchdog cannot be stopped once started
677 (default=kernel config parameter)
678
679-------------------------------------------------
680
681w83977f_wdt:
682 timeout:
683 Watchdog timeout in seconds (15..7635), default=45)
684 testmode:
685 Watchdog testmode (1 = no reboot), default=0
686 nowayout:
687 Watchdog cannot be stopped once started
688 (default=kernel config parameter)
689
690-------------------------------------------------
691
692wafer5823wdt:
693 timeout:
694 Watchdog timeout in seconds. 1 <= timeout <= 255, default=60.
695 nowayout:
696 Watchdog cannot be stopped once started
697 (default=kernel config parameter)
698
699-------------------------------------------------
700
701wdt285:
702 soft_margin:
703 Watchdog timeout in seconds (default=60)
704
705-------------------------------------------------
706
707wdt977:
708 timeout:
709 Watchdog timeout in seconds (60..15300, default=60)
710 testmode:
711 Watchdog testmode (1 = no reboot), default=0
712 nowayout:
713 Watchdog cannot be stopped once started
714 (default=kernel config parameter)
715
716-------------------------------------------------
717
718wm831x_wdt:
719 nowayout:
720 Watchdog cannot be stopped once started
721 (default=kernel config parameter)
722
723-------------------------------------------------
724
725wm8350_wdt:
726 nowayout:
727 Watchdog cannot be stopped once started
728 (default=kernel config parameter)
729
730-------------------------------------------------
731
732sun4v_wdt:
733 timeout_ms:
734 Watchdog timeout in milliseconds 1..180000, default=60000)
735 nowayout:
736 Watchdog cannot be stopped once started
diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt
deleted file mode 100644
index 0b88e333f9e1..000000000000
--- a/Documentation/watchdog/watchdog-parameters.txt
+++ /dev/null
@@ -1,410 +0,0 @@
1This file provides information on the module parameters of many of
2the Linux watchdog drivers. Watchdog driver parameter specs should
3be listed here unless the driver has its own driver-specific information
4file.
5
6
7See Documentation/admin-guide/kernel-parameters.rst for information on
8providing kernel parameters for builtin drivers versus loadable
9modules.
10
11
12-------------------------------------------------
13acquirewdt:
14wdt_stop: Acquire WDT 'stop' io port (default 0x43)
15wdt_start: Acquire WDT 'start' io port (default 0x443)
16nowayout: Watchdog cannot be stopped once started
17 (default=kernel config parameter)
18-------------------------------------------------
19advantechwdt:
20wdt_stop: Advantech WDT 'stop' io port (default 0x443)
21wdt_start: Advantech WDT 'start' io port (default 0x443)
22timeout: Watchdog timeout in seconds. 1<= timeout <=63, default=60.
23nowayout: Watchdog cannot be stopped once started
24 (default=kernel config parameter)
25-------------------------------------------------
26alim1535_wdt:
27timeout: Watchdog timeout in seconds. (0 < timeout < 18000, default=60
28nowayout: Watchdog cannot be stopped once started
29 (default=kernel config parameter)
30-------------------------------------------------
31alim7101_wdt:
32timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30
33use_gpio: Use the gpio watchdog (required by old cobalt boards).
34 default=0/off/no
35nowayout: Watchdog cannot be stopped once started
36 (default=kernel config parameter)
37-------------------------------------------------
38ar7_wdt:
39margin: Watchdog margin in seconds (default=60)
40nowayout: Disable watchdog shutdown on close
41 (default=kernel config parameter)
42-------------------------------------------------
43armada_37xx_wdt:
44timeout: Watchdog timeout in seconds. (default=120)
45nowayout: Disable watchdog shutdown on close
46 (default=kernel config parameter)
47-------------------------------------------------
48at91rm9200_wdt:
49wdt_time: Watchdog time in seconds. (default=5)
50nowayout: Watchdog cannot be stopped once started
51 (default=kernel config parameter)
52-------------------------------------------------
53at91sam9_wdt:
54heartbeat: Watchdog heartbeats in seconds. (default = 15)
55nowayout: Watchdog cannot be stopped once started
56 (default=kernel config parameter)
57-------------------------------------------------
58bcm47xx_wdt:
59wdt_time: Watchdog time in seconds. (default=30)
60nowayout: Watchdog cannot be stopped once started
61 (default=kernel config parameter)
62-------------------------------------------------
63coh901327_wdt:
64margin: Watchdog margin in seconds (default 60s)
65-------------------------------------------------
66cpu5wdt:
67port: base address of watchdog card, default is 0x91
68verbose: be verbose, default is 0 (no)
69ticks: count down ticks, default is 10000
70-------------------------------------------------
71cpwd:
72wd0_timeout: Default watchdog0 timeout in 1/10secs
73wd1_timeout: Default watchdog1 timeout in 1/10secs
74wd2_timeout: Default watchdog2 timeout in 1/10secs
75-------------------------------------------------
76da9052wdt:
77timeout: Watchdog timeout in seconds. 2<= timeout <=131, default=2.048s
78nowayout: Watchdog cannot be stopped once started
79 (default=kernel config parameter)
80-------------------------------------------------
81davinci_wdt:
82heartbeat: Watchdog heartbeat period in seconds from 1 to 600, default 60
83-------------------------------------------------
84ebc-c384_wdt:
85timeout: Watchdog timeout in seconds. (1<=timeout<=15300, default=60)
86nowayout: Watchdog cannot be stopped once started
87-------------------------------------------------
88ep93xx_wdt:
89nowayout: Watchdog cannot be stopped once started
90timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=TBD)
91-------------------------------------------------
92eurotechwdt:
93nowayout: Watchdog cannot be stopped once started
94 (default=kernel config parameter)
95io: Eurotech WDT io port (default=0x3f0)
96irq: Eurotech WDT irq (default=10)
97ev: Eurotech WDT event type (default is `int')
98-------------------------------------------------
99gef_wdt:
100nowayout: Watchdog cannot be stopped once started
101 (default=kernel config parameter)
102-------------------------------------------------
103geodewdt:
104timeout: Watchdog timeout in seconds. 1<= timeout <=131, default=60.
105nowayout: Watchdog cannot be stopped once started
106 (default=kernel config parameter)
107-------------------------------------------------
108i6300esb:
109heartbeat: Watchdog heartbeat in seconds. (1<heartbeat<2046, default=30)
110nowayout: Watchdog cannot be stopped once started
111 (default=kernel config parameter)
112-------------------------------------------------
113iTCO_wdt:
114heartbeat: Watchdog heartbeat in seconds.
115 (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30)
116nowayout: Watchdog cannot be stopped once started
117 (default=kernel config parameter)
118-------------------------------------------------
119iTCO_vendor_support:
120vendorsupport: iTCO vendor specific support mode, default=0 (none),
121 1=SuperMicro Pent3, 2=SuperMicro Pent4+, 911=Broken SMI BIOS
122-------------------------------------------------
123ib700wdt:
124timeout: Watchdog timeout in seconds. 0<= timeout <=30, default=30.
125nowayout: Watchdog cannot be stopped once started
126 (default=kernel config parameter)
127-------------------------------------------------
128ibmasr:
129nowayout: Watchdog cannot be stopped once started
130 (default=kernel config parameter)
131-------------------------------------------------
132imx2_wdt:
133timeout: Watchdog timeout in seconds (default 60 s)
134nowayout: Watchdog cannot be stopped once started
135 (default=kernel config parameter)
136-------------------------------------------------
137indydog:
138nowayout: Watchdog cannot be stopped once started
139 (default=kernel config parameter)
140-------------------------------------------------
141iop_wdt:
142nowayout: Watchdog cannot be stopped once started
143 (default=kernel config parameter)
144-------------------------------------------------
145it8712f_wdt:
146margin: Watchdog margin in seconds (default 60)
147nowayout: Disable watchdog shutdown on close
148 (default=kernel config parameter)
149-------------------------------------------------
150it87_wdt:
151nogameport: Forbid the activation of game port, default=0
152nocir: Forbid the use of CIR (workaround for some buggy setups); set to 1 if
153system resets despite watchdog daemon running, default=0
154exclusive: Watchdog exclusive device open, default=1
155timeout: Watchdog timeout in seconds, default=60
156testmode: Watchdog test mode (1 = no reboot), default=0
157nowayout: Watchdog cannot be stopped once started
158 (default=kernel config parameter)
159-------------------------------------------------
160ixp4xx_wdt:
161heartbeat: Watchdog heartbeat in seconds (default 60s)
162nowayout: Watchdog cannot be stopped once started
163 (default=kernel config parameter)
164-------------------------------------------------
165ks8695_wdt:
166wdt_time: Watchdog time in seconds. (default=5)
167nowayout: Watchdog cannot be stopped once started
168 (default=kernel config parameter)
169-------------------------------------------------
170machzwd:
171nowayout: Watchdog cannot be stopped once started
172 (default=kernel config parameter)
173action: after watchdog resets, generate:
174 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI
175-------------------------------------------------
176max63xx_wdt:
177heartbeat: Watchdog heartbeat period in seconds from 1 to 60, default 60
178nowayout: Watchdog cannot be stopped once started
179 (default=kernel config parameter)
180nodelay: Force selection of a timeout setting without initial delay
181 (max6373/74 only, default=0)
182-------------------------------------------------
183mixcomwd:
184nowayout: Watchdog cannot be stopped once started
185 (default=kernel config parameter)
186-------------------------------------------------
187mpc8xxx_wdt:
188timeout: Watchdog timeout in ticks. (0<timeout<65536, default=65535)
189reset: Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset
190nowayout: Watchdog cannot be stopped once started
191 (default=kernel config parameter)
192-------------------------------------------------
193mv64x60_wdt:
194nowayout: Watchdog cannot be stopped once started
195 (default=kernel config parameter)
196-------------------------------------------------
197ni903x_wdt:
198timeout: Initial watchdog timeout in seconds (0<timeout<516, default=60)
199nowayout: Watchdog cannot be stopped once started
200 (default=kernel config parameter)
201-------------------------------------------------
202nic7018_wdt:
203timeout: Initial watchdog timeout in seconds (0<timeout<464, default=80)
204nowayout: Watchdog cannot be stopped once started
205 (default=kernel config parameter)
206-------------------------------------------------
207nuc900_wdt:
208heartbeat: Watchdog heartbeats in seconds.
209 (default = 15)
210nowayout: Watchdog cannot be stopped once started
211 (default=kernel config parameter)
212-------------------------------------------------
213omap_wdt:
214timer_margin: initial watchdog timeout (in seconds)
215early_enable: Watchdog is started on module insertion (default=0
216nowayout: Watchdog cannot be stopped once started
217 (default=kernel config parameter)
218-------------------------------------------------
219orion_wdt:
220heartbeat: Initial watchdog heartbeat in seconds
221nowayout: Watchdog cannot be stopped once started
222 (default=kernel config parameter)
223-------------------------------------------------
224pc87413_wdt:
225io: pc87413 WDT I/O port (default: io).
226timeout: Watchdog timeout in minutes (default=timeout).
227nowayout: Watchdog cannot be stopped once started
228 (default=kernel config parameter)
229-------------------------------------------------
230pika_wdt:
231heartbeat: Watchdog heartbeats in seconds. (default = 15)
232nowayout: Watchdog cannot be stopped once started
233 (default=kernel config parameter)
234-------------------------------------------------
235pnx4008_wdt:
236heartbeat: Watchdog heartbeat period in seconds from 1 to 60, default 19
237nowayout: Set to 1 to keep watchdog running after device release
238-------------------------------------------------
239pnx833x_wdt:
240timeout: Watchdog timeout in Mhz. (68Mhz clock), default=2040000000 (30 seconds)
241nowayout: Watchdog cannot be stopped once started
242 (default=kernel config parameter)
243start_enabled: Watchdog is started on module insertion (default=1)
244-------------------------------------------------
245rc32434_wdt:
246timeout: Watchdog timeout value, in seconds (default=20)
247nowayout: Watchdog cannot be stopped once started
248 (default=kernel config parameter)
249-------------------------------------------------
250riowd:
251riowd_timeout: Watchdog timeout in minutes (default=1)
252-------------------------------------------------
253s3c2410_wdt:
254tmr_margin: Watchdog tmr_margin in seconds. (default=15)
255tmr_atboot: Watchdog is started at boot time if set to 1, default=0
256nowayout: Watchdog cannot be stopped once started
257 (default=kernel config parameter)
258soft_noboot: Watchdog action, set to 1 to ignore reboots, 0 to reboot
259debug: Watchdog debug, set to >1 for debug, (default 0)
260-------------------------------------------------
261sa1100_wdt:
262margin: Watchdog margin in seconds (default 60s)
263-------------------------------------------------
264sb_wdog:
265timeout: Watchdog timeout in microseconds (max/default 8388607 or 8.3ish secs)
266-------------------------------------------------
267sbc60xxwdt:
268wdt_stop: SBC60xx WDT 'stop' io port (default 0x45)
269wdt_start: SBC60xx WDT 'start' io port (default 0x443)
270timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30)
271nowayout: Watchdog cannot be stopped once started
272 (default=kernel config parameter)
273-------------------------------------------------
274sbc7240_wdt:
275timeout: Watchdog timeout in seconds. (1<=timeout<=255, default=30)
276nowayout: Disable watchdog when closing device file
277-------------------------------------------------
278sbc8360:
279timeout: Index into timeout table (0-63) (default=27 (60s))
280nowayout: Watchdog cannot be stopped once started
281 (default=kernel config parameter)
282-------------------------------------------------
283sbc_epx_c3:
284nowayout: Watchdog cannot be stopped once started
285 (default=kernel config parameter)
286-------------------------------------------------
287sbc_fitpc2_wdt:
288margin: Watchdog margin in seconds (default 60s)
289nowayout: Watchdog cannot be stopped once started
290-------------------------------------------------
291sbsa_gwdt:
292timeout: Watchdog timeout in seconds. (default 10s)
293action: Watchdog action at the first stage timeout,
294 set to 0 to ignore, 1 to panic. (default=0)
295nowayout: Watchdog cannot be stopped once started
296 (default=kernel config parameter)
297-------------------------------------------------
298sc1200wdt:
299isapnp: When set to 0 driver ISA PnP support will be disabled (default=1)
300io: io port
301timeout: range is 0-255 minutes, default is 1
302nowayout: Watchdog cannot be stopped once started
303 (default=kernel config parameter)
304-------------------------------------------------
305sc520_wdt:
306timeout: Watchdog timeout in seconds. (1 <= timeout <= 3600, default=30)
307nowayout: Watchdog cannot be stopped once started
308 (default=kernel config parameter)
309-------------------------------------------------
310sch311x_wdt:
311force_id: Override the detected device ID
312therm_trip: Should a ThermTrip trigger the reset generator
313timeout: Watchdog timeout in seconds. 1<= timeout <=15300, default=60
314nowayout: Watchdog cannot be stopped once started
315 (default=kernel config parameter)
316-------------------------------------------------
317scx200_wdt:
318margin: Watchdog margin in seconds
319nowayout: Disable watchdog shutdown on close
320-------------------------------------------------
321shwdt:
322clock_division_ratio: Clock division ratio. Valid ranges are from 0x5 (1.31ms)
323 to 0x7 (5.25ms). (default=7)
324heartbeat: Watchdog heartbeat in seconds. (1 <= heartbeat <= 3600, default=30
325nowayout: Watchdog cannot be stopped once started
326 (default=kernel config parameter)
327-------------------------------------------------
328smsc37b787_wdt:
329timeout: range is 1-255 units, default is 60
330nowayout: Watchdog cannot be stopped once started
331 (default=kernel config parameter)
332-------------------------------------------------
333softdog:
334soft_margin: Watchdog soft_margin in seconds.
335 (0 < soft_margin < 65536, default=60)
336nowayout: Watchdog cannot be stopped once started
337 (default=kernel config parameter)
338soft_noboot: Softdog action, set to 1 to ignore reboots, 0 to reboot
339 (default=0)
340-------------------------------------------------
341stmp3xxx_wdt:
342heartbeat: Watchdog heartbeat period in seconds from 1 to 4194304, default 19
343-------------------------------------------------
344tegra_wdt:
345heartbeat: Watchdog heartbeats in seconds. (default = 120)
346nowayout: Watchdog cannot be stopped once started
347 (default=kernel config parameter)
348-------------------------------------------------
349ts72xx_wdt:
350timeout: Watchdog timeout in seconds. (1 <= timeout <= 8, default=8)
351nowayout: Disable watchdog shutdown on close
352-------------------------------------------------
353twl4030_wdt:
354nowayout: Watchdog cannot be stopped once started
355 (default=kernel config parameter)
356-------------------------------------------------
357txx9wdt:
358timeout: Watchdog timeout in seconds. (0<timeout<N, default=60)
359nowayout: Watchdog cannot be stopped once started
360 (default=kernel config parameter)
361-------------------------------------------------
362uniphier_wdt:
363timeout: Watchdog timeout in power of two seconds.
364 (1 <= timeout <= 128, default=64)
365nowayout: Watchdog cannot be stopped once started
366 (default=kernel config parameter)
367-------------------------------------------------
368w83627hf_wdt:
369wdt_io: w83627hf/thf WDT io port (default 0x2E)
370timeout: Watchdog timeout in seconds. 1 <= timeout <= 255, default=60.
371nowayout: Watchdog cannot be stopped once started
372 (default=kernel config parameter)
373-------------------------------------------------
374w83877f_wdt:
375timeout: Watchdog timeout in seconds. (1<=timeout<=3600, default=30)
376nowayout: Watchdog cannot be stopped once started
377 (default=kernel config parameter)
378-------------------------------------------------
379w83977f_wdt:
380timeout: Watchdog timeout in seconds (15..7635), default=45)
381testmode: Watchdog testmode (1 = no reboot), default=0
382nowayout: Watchdog cannot be stopped once started
383 (default=kernel config parameter)
384-------------------------------------------------
385wafer5823wdt:
386timeout: Watchdog timeout in seconds. 1 <= timeout <= 255, default=60.
387nowayout: Watchdog cannot be stopped once started
388 (default=kernel config parameter)
389-------------------------------------------------
390wdt285:
391soft_margin: Watchdog timeout in seconds (default=60)
392-------------------------------------------------
393wdt977:
394timeout: Watchdog timeout in seconds (60..15300, default=60)
395testmode: Watchdog testmode (1 = no reboot), default=0
396nowayout: Watchdog cannot be stopped once started
397 (default=kernel config parameter)
398-------------------------------------------------
399wm831x_wdt:
400nowayout: Watchdog cannot be stopped once started
401 (default=kernel config parameter)
402-------------------------------------------------
403wm8350_wdt:
404nowayout: Watchdog cannot be stopped once started
405 (default=kernel config parameter)
406-------------------------------------------------
407sun4v_wdt:
408timeout_ms: Watchdog timeout in milliseconds 1..180000, default=60000)
409nowayout: Watchdog cannot be stopped once started
410-------------------------------------------------
diff --git a/Documentation/watchdog/watchdog-pm.txt b/Documentation/watchdog/watchdog-pm.rst
index 7a4dd46e0d24..646e1f28f31f 100644
--- a/Documentation/watchdog/watchdog-pm.txt
+++ b/Documentation/watchdog/watchdog-pm.rst
@@ -1,5 +1,7 @@
1===============================================
1The Linux WatchDog Timer Power Management Guide 2The Linux WatchDog Timer Power Management Guide
2=============================================== 3===============================================
4
3Last reviewed: 17-Dec-2018 5Last reviewed: 17-Dec-2018
4 6
5Wolfram Sang <wsa+renesas@sang-engineering.com> 7Wolfram Sang <wsa+renesas@sang-engineering.com>
@@ -16,4 +18,5 @@ On resume, a watchdog timer shall be reset to its selected value to give
16userspace enough time to resume. [1] [2] 18userspace enough time to resume. [1] [2]
17 19
18[1] https://patchwork.kernel.org/patch/10252209/ 20[1] https://patchwork.kernel.org/patch/10252209/
21
19[2] https://patchwork.kernel.org/patch/10711625/ 22[2] https://patchwork.kernel.org/patch/10711625/
diff --git a/Documentation/watchdog/wdt.txt b/Documentation/watchdog/wdt.rst
index ed2f0b860869..d97b0361535b 100644
--- a/Documentation/watchdog/wdt.txt
+++ b/Documentation/watchdog/wdt.rst
@@ -1,11 +1,14 @@
1============================================================
2WDT Watchdog Timer Interfaces For The Linux Operating System
3============================================================
4
1Last Reviewed: 10/05/2007 5Last Reviewed: 10/05/2007
2 6
3 WDT Watchdog Timer Interfaces For The Linux Operating System 7Alan Cox <alan@lxorguk.ukuu.org.uk>
4 Alan Cox <alan@lxorguk.ukuu.org.uk>
5 8
6 ICS WDT501-P 9 - ICS WDT501-P
7 ICS WDT501-P (no fan tachometer) 10 - ICS WDT501-P (no fan tachometer)
8 ICS WDT500-P 11 - ICS WDT500-P
9 12
10All the interfaces provide /dev/watchdog, which when open must be written 13All the interfaces provide /dev/watchdog, which when open must be written
11to within a timeout or the machine will reboot. Each write delays the reboot 14to within a timeout or the machine will reboot. Each write delays the reboot
@@ -21,19 +24,26 @@ degrees Fahrenheit. Each read returns a single byte giving the temperature.
21The third interface logs kernel messages on additional alert events. 24The third interface logs kernel messages on additional alert events.
22 25
23The ICS ISA-bus wdt card cannot be safely probed for. Instead you need to 26The ICS ISA-bus wdt card cannot be safely probed for. Instead you need to
24pass IO address and IRQ boot parameters. E.g.: 27pass IO address and IRQ boot parameters. E.g.::
28
25 wdt.io=0x240 wdt.irq=11 29 wdt.io=0x240 wdt.irq=11
26 30
27Other "wdt" driver parameters are: 31Other "wdt" driver parameters are:
32
33 =========== ======================================================
28 heartbeat Watchdog heartbeat in seconds (default 60) 34 heartbeat Watchdog heartbeat in seconds (default 60)
29 nowayout Watchdog cannot be stopped once started (kernel 35 nowayout Watchdog cannot be stopped once started (kernel
30 build parameter) 36 build parameter)
31 tachometer WDT501-P Fan Tachometer support (0=disable, default=0) 37 tachometer WDT501-P Fan Tachometer support (0=disable, default=0)
32 type WDT501-P Card type (500 or 501, default=500) 38 type WDT501-P Card type (500 or 501, default=500)
39 =========== ======================================================
33 40
34Features 41Features
35-------- 42--------
36 WDT501P WDT500P 43
44================ ======= =======
45 WDT501P WDT500P
46================ ======= =======
37Reboot Timer X X 47Reboot Timer X X
38External Reboot X X 48External Reboot X X
39I/O Port Monitor o o 49I/O Port Monitor o o
@@ -42,9 +52,12 @@ Fan Speed X o
42Power Under X o 52Power Under X o
43Power Over X o 53Power Over X o
44Overheat X o 54Overheat X o
55================ ======= =======
45 56
46The external event interfaces on the WDT boards are not currently supported. 57The external event interfaces on the WDT boards are not currently supported.
47Minor numbers are however allocated for it. 58Minor numbers are however allocated for it.
48 59
49 60
50Example Watchdog Driver: see samples/watchdog/watchdog-simple.c 61Example Watchdog Driver:
62
63 see samples/watchdog/watchdog-simple.c