|
@@ -65,6 +65,7 @@ struct watchdog_ops {
|
|
* @timeout: The watchdog devices timeout value (in seconds).
|
|
* @timeout: The watchdog devices timeout value (in seconds).
|
|
* @min_timeout:The watchdog devices minimum timeout value (in seconds).
|
|
* @min_timeout:The watchdog devices minimum timeout value (in seconds).
|
|
* @max_timeout:The watchdog devices maximum timeout value (in seconds).
|
|
* @max_timeout:The watchdog devices maximum timeout value (in seconds).
|
|
|
|
+ * @reboot_nb: The notifier block to stop watchdog on reboot.
|
|
* @restart_nb: The notifier block to register a restart function.
|
|
* @restart_nb: The notifier block to register a restart function.
|
|
* @driver-data:Pointer to the drivers private data.
|
|
* @driver-data:Pointer to the drivers private data.
|
|
* @lock: Lock for watchdog core internal use only.
|
|
* @lock: Lock for watchdog core internal use only.
|
|
@@ -92,6 +93,7 @@ struct watchdog_device {
|
|
unsigned int timeout;
|
|
unsigned int timeout;
|
|
unsigned int min_timeout;
|
|
unsigned int min_timeout;
|
|
unsigned int max_timeout;
|
|
unsigned int max_timeout;
|
|
|
|
+ struct notifier_block reboot_nb;
|
|
struct notifier_block restart_nb;
|
|
struct notifier_block restart_nb;
|
|
void *driver_data;
|
|
void *driver_data;
|
|
struct mutex lock;
|
|
struct mutex lock;
|
|
@@ -102,6 +104,7 @@ struct watchdog_device {
|
|
#define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */
|
|
#define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */
|
|
#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
|
|
#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
|
|
#define WDOG_UNREGISTERED 4 /* Has the device been unregistered */
|
|
#define WDOG_UNREGISTERED 4 /* Has the device been unregistered */
|
|
|
|
+#define WDOG_STOP_ON_REBOOT 5 /* Should be stopped on reboot */
|
|
struct list_head deferred;
|
|
struct list_head deferred;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -121,6 +124,12 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway
|
|
set_bit(WDOG_NO_WAY_OUT, &wdd->status);
|
|
set_bit(WDOG_NO_WAY_OUT, &wdd->status);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* Use the following function to stop the watchdog on reboot */
|
|
|
|
+static inline void watchdog_stop_on_reboot(struct watchdog_device *wdd)
|
|
|
|
+{
|
|
|
|
+ set_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
|
|
|
|
+}
|
|
|
|
+
|
|
/* Use the following function to check if a timeout value is invalid */
|
|
/* Use the following function to check if a timeout value is invalid */
|
|
static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
|
|
static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
|
|
{
|
|
{
|