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.
43 * This is ugly, but I've determined that x86 is the only architecture
57 * The IPMI command/response information for the watchdog timer.
98 * pre-timeout in seconds.
109 * Setting/getting the watchdog timer value. This is for bytes 5 and
135 /* The pre-timeout is disabled by default. */
160 static int ifnum_to_use = -1;
184 return -EINVAL; in set_param_timeout()
187 return -EINVAL; in set_param_timeout()
189 *((int *)kp->arg) = l; in set_param_timeout()
211 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()
434 return -ENODEV; in _ipmi_set_timeout()
471 * Don't reset the timer if we have the timer turned off, that in panic_halt_ipmi_heartbeat()
472 * re-enables the watchdog. in panic_halt_ipmi_heartbeat()
490 * Special call, doesn't claim any locks. This is only to be called
491 * at panic or halt time, in run-to-completion mode, when the caller
492 * is the only CPU and the only thing that will be going is these IPMI
518 * Don't reset the timer if we have the timer turned off, that in __ipmi_heartbeat()
519 * re-enables the watchdog. in __ipmi_heartbeat()
555 rv = -EIO; in __ipmi_heartbeat()
560 * The timer was not initialized, that means the BMC was in __ipmi_heartbeat()
562 * to restore the timer's info. Note that we still hold in __ipmi_heartbeat()
581 rv = -EINVAL; in __ipmi_heartbeat()
593 return -ENODEV; in _ipmi_heartbeat()
641 return i ? -EFAULT : 0; in ipmi_ioctl()
646 return -EFAULT; in ipmi_ioctl()
653 return -EFAULT; in ipmi_ioctl()
659 return -EFAULT; in ipmi_ioctl()
666 return -EFAULT; in ipmi_ioctl()
675 return -EFAULT; in ipmi_ioctl()
692 return -EFAULT; in ipmi_ioctl()
696 return -ENOIOCTLCMD; in ipmi_ioctl()
731 return -EFAULT; in ipmi_write()
755 * Reading returns if the pretimeout has gone off, and it only does in ipmi_read()
760 if (file->f_flags & O_NONBLOCK) { in ipmi_read()
761 rv = -EAGAIN; in ipmi_read()
776 rv = -ERESTARTSYS; in ipmi_read()
787 rv = -EFAULT; in ipmi_read()
800 return -EBUSY; in ipmi_open()
804 * Don't start the timer now, let it start on the in ipmi_open()
811 return (-ENODEV); in ipmi_open()
879 if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER && in ipmi_wdog_msg_handler()
880 msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP) in ipmi_wdog_msg_handler()
881 …he IPMI controller appears to have been reset, will attempt to reinitialize the watchdog timer\n"); in ipmi_wdog_msg_handler()
882 else if (msg->msg.data[0] != 0) in ipmi_wdog_msg_handler()
884 msg->msg.data[0], in ipmi_wdog_msg_handler()
885 msg->msg.cmd); in ipmi_wdog_msg_handler()
895 panic("Watchdog pre-timeout"); in ipmi_wdog_pretimeout_handler()
907 * work unless we re-enable the timer. So do so. in ipmi_wdog_pretimeout_handler()
918 * the watchdog timer to a reasonable value to complete the in ipmi_wdog_panic_handler()
919 * panic, if the watchdog timer is running. Plus the in ipmi_wdog_panic_handler()
924 /* Make sure we do this only once. */ in ipmi_wdog_panic_handler()
941 int rv = -EBUSY; in ipmi_register_watchdog()
981 * ourselves plenty of time to stop the timer. in ipmi_register_watchdog()
992 pr_warn("Error starting timer to test NMI: 0x%x. The NMI pretimeout will likely not work\n", in ipmi_register_watchdog()
1013 /* Run from startup, so start the timer now. */ in ipmi_register_watchdog()
1019 /* Stop the timer now. */ in ipmi_register_watchdog()
1035 /* Make sure no one can call us any more. */ in ipmi_unregister_watchdog()
1083 * If no one else handled the NMI, we assume it was the IPMI in ipmi_nmi()
1088 an error and not work unless we re-enable in ipmi_nmi()
1089 the timer. So do so. */ in ipmi_nmi()
1092 nmi_panic(regs, "pre-timeout"); in ipmi_nmi()
1106 /* Make sure we only do this once. */ in wdog_reboot_handler()
1114 /* Set a long timer to let the reboot happen or in wdog_reboot_handler()
1115 reset if it hangs, but only if the watchdog in wdog_reboot_handler()
1116 timer was already running. */ in wdog_reboot_handler()
1160 return -EINVAL; in action_op_set_val()
1192 return -EINVAL; in preaction_op_set_val()
1220 return -EINVAL; in preop_op_set_val()
1325 MODULE_DESCRIPTION("watchdog timer based upon the IPMI interface.");