Lines Matching +full:one +full:- +full:timer +full:- +full:only

1 // SPDX-License-Identifier: GPL-2.0+
5 * A watchdog timer based upon the IPMI interface.
42 * This is ugly, but I've determined that x86 is the only architecture
56 * The IPMI command/response information for the watchdog timer.
97 * pre-timeout in seconds.
108 * Setting/getting the watchdog timer value. This is for bytes 5 and
134 /* The pre-timeout is disabled by default. */
159 static int ifnum_to_use = -1;
183 return -EINVAL; in set_param_timeout()
186 return -EINVAL; in set_param_timeout()
188 *((int *)kp->arg) = l; in set_param_timeout()
210 action_fn fn = (action_fn) kp->arg; in set_param_str()
234 action_fn fn = (action_fn) kp->arg; in get_param_str()
276 "timer. Setting to -1 defaults to the first registered "
289 MODULE_PARM_DESC(action, "Timeout action. One of: "
293 MODULE_PARM_DESC(preaction, "Pretimeout action. One of: "
297 MODULE_PARM_DESC(preop, "Pretimeout driver operation. One of: "
308 /* Default state of the timer. */
311 /* Is someone using the watchdog? Only one user is allowed. */
316 * start the timer. The timer doesn't normally run when the driver is
326 /* If a pretimeout occurs, this is used to allow only one panic to happen. */
327 static atomic_t preop_panic_excl = ATOMIC_INIT(-1);
337 * We use a mutex to make sure that only one thing can send a set a
338 * message at one time. The mutex is claimed when a message is sent
377 /* This is an IPMI 1.5-only feature. */ in __ipmi_set_timeout()
381 * In ipmi 1.0, setting the timer stops the watchdog, we in __ipmi_set_timeout()
430 return -ENODEV; in _ipmi_set_timeout()
486 * Don't reset the timer if we have the timer turned off, that in panic_halt_ipmi_heartbeat()
487 * re-enables the watchdog. in panic_halt_ipmi_heartbeat()
519 * Special call, doesn't claim any locks. This is only to be called
520 * at panic or halt time, in run-to-completion mode, when the caller
521 * is the only CPU and the only thing that will be going is these IPMI
556 * Don't reset the timer if we have the timer turned off, that in __ipmi_heartbeat()
557 * re-enables the watchdog. in __ipmi_heartbeat()
593 rv = -EIO; in __ipmi_heartbeat()
598 * The timer was not initialized, that means the BMC was in __ipmi_heartbeat()
600 * to restore the timer's info. Note that we still hold in __ipmi_heartbeat()
619 rv = -EINVAL; in __ipmi_heartbeat()
631 return -ENODEV; in _ipmi_heartbeat()
679 return i ? -EFAULT : 0; in ipmi_ioctl()
684 return -EFAULT; in ipmi_ioctl()
691 return -EFAULT; in ipmi_ioctl()
697 return -EFAULT; in ipmi_ioctl()
704 return -EFAULT; in ipmi_ioctl()
713 return -EFAULT; in ipmi_ioctl()
730 return -EFAULT; in ipmi_ioctl()
734 return -ENOIOCTLCMD; in ipmi_ioctl()
769 return -EFAULT; in ipmi_write()
793 * Reading returns if the pretimeout has gone off, and it only does in ipmi_read()
798 if (file->f_flags & O_NONBLOCK) { in ipmi_read()
799 rv = -EAGAIN; in ipmi_read()
814 rv = -ERESTARTSYS; in ipmi_read()
825 rv = -EFAULT; in ipmi_read()
838 return -EBUSY; in ipmi_open()
842 * Don't start the timer now, let it start on the in ipmi_open()
849 return (-ENODEV); in ipmi_open()
918 if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER && in ipmi_wdog_msg_handler()
919 msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP) in ipmi_wdog_msg_handler()
920 …he IPMI controller appears to have been reset, will attempt to reinitialize the watchdog timer\n"); in ipmi_wdog_msg_handler()
921 else if (msg->msg.data[0] != 0) in ipmi_wdog_msg_handler()
923 msg->msg.data[0], in ipmi_wdog_msg_handler()
924 msg->msg.cmd); in ipmi_wdog_msg_handler()
934 panic("Watchdog pre-timeout"); in ipmi_wdog_pretimeout_handler()
948 * work unless we re-enable the timer. So do so. in ipmi_wdog_pretimeout_handler()
959 * the watchdog timer to a reasonable value to complete the in ipmi_wdog_panic_handler()
960 * panic, if the watchdog timer is running. Plus the in ipmi_wdog_panic_handler()
965 /* Make sure we do this only once. */ in ipmi_wdog_panic_handler()
982 int rv = -EBUSY; in ipmi_register_watchdog()
1022 * ourselves plenty of time to stop the timer. in ipmi_register_watchdog()
1033 pr_warn("Error starting timer to test NMI: 0x%x. The NMI pretimeout will likely not work\n", in ipmi_register_watchdog()
1054 /* Run from startup, so start the timer now. */ in ipmi_register_watchdog()
1060 /* Stop the timer now. */ in ipmi_register_watchdog()
1077 /* Make sure no one can call us any more. */ in ipmi_unregister_watchdog()
1127 * If no one else handled the NMI, we assume it was the IPMI in ipmi_nmi()
1132 an error and not work unless we re-enable in ipmi_nmi()
1133 the timer. So do so. */ in ipmi_nmi()
1136 nmi_panic(regs, "pre-timeout"); in ipmi_nmi()
1150 /* Make sure we only do this once. */ in wdog_reboot_handler()
1158 /* Set a long timer to let the reboot happen or in wdog_reboot_handler()
1159 reset if it hangs, but only if the watchdog in wdog_reboot_handler()
1160 timer was already running. */ in wdog_reboot_handler()
1210 return -EINVAL; in action_op()
1234 return -EINVAL; in preaction_op()
1254 return -EINVAL; in preop_op()
1344 MODULE_DESCRIPTION("watchdog timer based upon the IPMI interface.");