Lines Matching full:watchdog
13 * by all the watchdog timer drivers.
16 * misc device: /dev/watchdog.
44 #include <linux/watchdog.h> /* For watchdog specific items */
50 #include <trace/events/watchdog.h>
52 /* the dev_t structure to store the dynamically allocated watchdog devices */
54 /* Reference to watchdog device behind /dev/watchdog */
84 * - Userspace activated the watchdog. in watchdog_need_worker()
90 * Alternatively, if userspace has not opened the watchdog in watchdog_need_worker()
91 * device, we take care of feeding the watchdog if it is in watchdog_need_worker()
117 * To ensure that the watchdog times out wdd->timeout seconds in watchdog_next_keepalive()
163 err = wdd->ops->ping(wdd); /* ping the watchdog */ in __watchdog_ping()
166 err = wdd->ops->start(wdd); /* restart watchdog */ in __watchdog_ping()
179 * watchdog_ping - ping the watchdog
180 * @wdd: The watchdog device to ping
182 * If the watchdog has no own ping operation then it needs to be
185 * We only ping when the watchdog device is running.
239 * watchdog_start - wrapper to start the watchdog
240 * @wdd: The watchdog device to start
242 * Start the watchdog if it is not active and mark it active.
281 * watchdog_stop - wrapper to stop the watchdog
282 * @wdd: The watchdog device to stop
284 * Stop the watchdog if it is still active and unmark it active.
285 * If the 'nowayout' feature was set, the watchdog cannot be stopped.
298 pr_info("watchdog%d: nowayout prevents watchdog being stopped!\n", in watchdog_stop()
321 * watchdog_get_status - wrapper to get the watchdog status
322 * @wdd: The watchdog device to get the status from
324 * Get the watchdog's status flags.
327 * Return: watchdog's status flags.
358 * watchdog_set_timeout - set the watchdog timer timeout
359 * @wdd: The watchdog device to set the timeout for
393 * watchdog_set_pretimeout - set the watchdog timer pretimeout
394 * @wdd: The watchdog device to set the timeout for
420 * @wdd: The watchdog device to get the remaining time from
423 * Get the time before a watchdog will reboot (if not pinged).
644 * watchdog_ioctl_op - call the watchdog drivers ioctl op if defined
645 * @wdd: The watchdog device to do the ioctl on
646 * @cmd: Watchdog command
663 * watchdog_write - writes to the watchdog
669 * A write to a watchdog device is defined as a keepalive ping.
671 * off the watchdog (if 'nowayout' is not set).
701 /* someone wrote to us, so we send the watchdog a keepalive ping */ in watchdog_write()
717 * watchdog_ioctl - handle the different ioctl's for the watchdog device
719 * @cmd: Watchdog command
722 * The watchdog API defines a common set of functions for all watchdogs
790 /* If the watchdog is active then we send a keepalive ping in watchdog_ioctl()
791 * to make sure that the watchdog keep's running (and if in watchdog_ioctl()
832 * watchdog_open - open the /dev/watchdog* devices
836 * When the /dev/watchdog* device gets opened, we start the watchdog.
837 * Watch out: the /dev/watchdog device is single open, so we make sure
849 /* Get the corresponding watchdog device */ in watchdog_open()
856 /* the watchdog is single open! */ in watchdog_open()
863 * If the /dev/watchdog device is open, we don't want the module in watchdog_open()
884 * will take care of an always-running hardware watchdog in in watchdog_open()
890 /* dev/watchdog is a virtual (and thus non-seekable) filesystem */ in watchdog_open()
910 * watchdog_release - release the watchdog device
914 * This is the code for when /dev/watchdog gets closed. We will only
915 * stop the watchdog when we have received the magic char (and nowayout
916 * was not set), else the watchdog will keep running.
934 * We only stop the watchdog if we received the magic character in watchdog_release()
944 /* If the watchdog was not stopped, send a keepalive ping */ in watchdog_release()
946 pr_crit("watchdog%d: watchdog did not stop!\n", wdd->id); in watchdog_release()
952 /* make sure that /dev/watchdog can be re-opened */ in watchdog_release()
959 * Allow the owner module to be unloaded again unless the watchdog in watchdog_release()
960 * is still running. If the watchdog is still running, it can not in watchdog_release()
981 .name = "watchdog",
986 .name = "watchdog",
992 * watchdog_cdev_register - register watchdog character device
993 * @wdd: Watchdog device
995 * Register a watchdog character device including handling the legacy
996 * /dev/watchdog node. /dev/watchdog is actually a miscdevice and
1026 err = dev_set_name(&wd_data->dev, "watchdog%d", wdd->id); in watchdog_cdev_register()
1045 pr_err("%s: a legacy watchdog module is probably present.\n", in watchdog_cdev_register()
1059 pr_err("watchdog%d unable to add device %d:%d\n", in watchdog_cdev_register()
1076 * If the watchdog is running, prevent its driver from being unloaded, in watchdog_cdev_register()
1086 pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n", in watchdog_cdev_register()
1094 * watchdog_cdev_unregister - unregister watchdog character device
1095 * @wdd: Watchdog device
1097 * Unregister watchdog character device and if needed the legacy
1098 * /dev/watchdog device.
1129 * watchdog_dev_register - register a watchdog device
1130 * @wdd: Watchdog device
1132 * Register a watchdog device including handling the legacy
1133 * /dev/watchdog node. /dev/watchdog is actually a miscdevice and
1154 * watchdog_dev_unregister - unregister a watchdog device
1155 * @wdd: watchdog device
1157 * Unregister watchdog device and if needed the legacy
1158 * /dev/watchdog device.
1167 * watchdog_set_last_hw_keepalive - set last HW keepalive time for watchdog
1168 * @wdd: Watchdog device
1171 * Adjusts the last known HW keepalive time for a watchdog timer.
1172 * This is needed if the watchdog is already running when the probe
1174 * function must be called immediately after watchdog registration,
1202 * watchdog_dev_init - init dev part of watchdog core
1204 * Allocate a range of chardev nodes to use for watchdog devices.
1214 pr_err("Failed to create watchdog kworker\n"); in watchdog_dev_init()
1225 err = alloc_chrdev_region(&watchdog_devt, 0, MAX_DOGS, "watchdog"); in watchdog_dev_init()
1227 pr_err("watchdog: unable to allocate char dev region\n"); in watchdog_dev_init()
1241 * watchdog_dev_exit - exit dev part of watchdog core
1243 * Release the range of chardev nodes used for watchdog devices.
1270 * make sure that watchdog worker will not kick in when the wdog is in watchdog_dev_suspend()
1301 "Watchdog core auto-updates boot enabled watchdogs before userspace takes over (default="
1306 …"Maximum time (in seconds, 0 means infinity) for userspace to take over a running watchdog (defaul…