aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/watchdog.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-02-28 16:12:16 -0500
committerWim Van Sebroeck <wim@iguana.be>2016-03-16 16:11:15 -0400
commitee142889e32f564f9b5e57b68b06693ec5473074 (patch)
tree69afe4a8324087bbd96636048f9b306d5a84eb28 /include/linux/watchdog.h
parent664a39236e718f9f03fa73fc01006da9ced04efc (diff)
watchdog: Introduce WDOG_HW_RUNNING flag
The WDOG_HW_RUNNING flag is expected to be set by watchdog drivers if the hardware watchdog is running. If the flag is set, the watchdog subsystem will ping the watchdog even if the watchdog device is closed. The watchdog driver stop function is now optional and may be omitted if the watchdog can not be stopped. If stopping the watchdog is not possible but the driver implements a stop function, it is responsible to set the WDOG_HW_RUNNING flag in its stop function. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'include/linux/watchdog.h')
-rw-r--r--include/linux/watchdog.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 8e82daecb7d3..e2f45549b243 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -105,6 +105,7 @@ struct watchdog_device {
105#define WDOG_ACTIVE 0 /* Is the watchdog running/active */ 105#define WDOG_ACTIVE 0 /* Is the watchdog running/active */
106#define WDOG_NO_WAY_OUT 1 /* Is 'nowayout' feature set ? */ 106#define WDOG_NO_WAY_OUT 1 /* Is 'nowayout' feature set ? */
107#define WDOG_STOP_ON_REBOOT 2 /* Should be stopped on reboot */ 107#define WDOG_STOP_ON_REBOOT 2 /* Should be stopped on reboot */
108#define WDOG_HW_RUNNING 3 /* True if HW watchdog running */
108 struct list_head deferred; 109 struct list_head deferred;
109}; 110};
110 111
@@ -117,6 +118,15 @@ static inline bool watchdog_active(struct watchdog_device *wdd)
117 return test_bit(WDOG_ACTIVE, &wdd->status); 118 return test_bit(WDOG_ACTIVE, &wdd->status);
118} 119}
119 120
121/*
122 * Use the following function to check whether or not the hardware watchdog
123 * is running
124 */
125static inline bool watchdog_hw_running(struct watchdog_device *wdd)
126{
127 return test_bit(WDOG_HW_RUNNING, &wdd->status);
128}
129
120/* Use the following function to set the nowayout feature */ 130/* Use the following function to set the nowayout feature */
121static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout) 131static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout)
122{ 132{