Lines Matching +full:reset +full:- +full:on +full:- +full:timeout
1 // SPDX-License-Identifier: GPL-2.0+
44 * that can reasonably support the IPMI NMI watchdog timeout at this
81 /* Operations that can be performed on a pretimout. */
87 /* Actions to perform on a full timeout. */
98 * pre-timeout in seconds.
110 * 6 (the timeout time) of the set command, and bytes 6 and 7 (the
111 * timeout time) and 8 and 9 (the current countdown value) of the
112 * response. The timeout value is given in seconds (in the command it
132 /* Default the timeout to 10 seconds. */
133 static int timeout = 10; variable
135 /* The pre-timeout is disabled by default. */
138 /* Default timeout to set on panic */
141 /* Default action is to reset the board on a timeout. */
144 static char action[16] = "reset";
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 "
279 module_param(timeout, timeout, 0644);
280 MODULE_PARM_DESC(timeout, "Timeout value in seconds.");
282 module_param(pretimeout, timeout, 0644);
285 module_param(panic_wdt_timeout, timeout, 0644);
286 MODULE_PARM_DESC(panic_wdt_timeout, "Timeout value on kernel panic in seconds.");
289 MODULE_PARM_DESC(action, "Timeout action. One of: "
290 "reset, none, power_cycle, power_off.");
315 * If set to 1, the heartbeat command will set the state to reset and
327 static atomic_t preop_panic_excl = ATOMIC_INIT(-1);
377 /* This is an IPMI 1.5-only feature. */ in __ipmi_set_timeout()
398 WDOG_SET_TIMEOUT(data[4], data[5], timeout); in __ipmi_set_timeout()
417 pr_warn("set timeout error: %d\n", rv); 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()
520 * at panic or halt time, in run-to-completion mode, when the caller
538 pr_warn("Unable to extend the watchdog timeout\n"); in panic_halt_ipmi_set_timeout()
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()
599 * probably reset and lost the watchdog information. Attempt in __ipmi_heartbeat()
603 * deadlock on this mutex in __ipmi_heartbeat()
619 rv = -EINVAL; in __ipmi_heartbeat()
631 return -ENODEV; in _ipmi_heartbeat()
639 * A pretimeout occurred, make sure we set the timeout. in _ipmi_heartbeat()
679 return i ? -EFAULT : 0; in ipmi_ioctl()
684 return -EFAULT; in ipmi_ioctl()
685 timeout = val; in ipmi_ioctl()
689 i = copy_to_user(argp, &timeout, sizeof(timeout)); 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()
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()
867 static int ipmi_fasync(int fd, struct file *file, int on) in ipmi_fasync() argument
871 result = fasync_helper(fd, file, on, &fasync_q); in ipmi_fasync()
917 if (msg->msg.cmd == IPMI_WDOG_RESET_TIMER && in ipmi_wdog_msg_handler()
918 msg->msg.data[0] == IPMI_WDOG_TIMER_NOT_INIT_RESP) in ipmi_wdog_msg_handler()
919 …pr_info("response: The IPMI controller appears to have been reset, will attempt to reinitialize th… in ipmi_wdog_msg_handler()
920 else if (msg->msg.data[0] != 0) in ipmi_wdog_msg_handler()
921 pr_err("response: Error %x on cmd %x\n", in ipmi_wdog_msg_handler()
922 msg->msg.data[0], in ipmi_wdog_msg_handler()
923 msg->msg.cmd); in ipmi_wdog_msg_handler()
933 panic("Watchdog pre-timeout"); in ipmi_wdog_pretimeout_handler()
946 * On some machines, the heartbeat will give an error and not in ipmi_wdog_pretimeout_handler()
947 * work unless we re-enable the timer. So do so. in ipmi_wdog_pretimeout_handler()
957 * On a panic, if we have a panic timeout, make sure to extend in ipmi_wdog_panic_handler()
967 timeout = panic_wdt_timeout; in ipmi_wdog_panic_handler()
981 int rv = -EBUSY; in ipmi_register_watchdog()
1016 int old_timeout = timeout; in ipmi_register_watchdog()
1026 timeout = 100; in ipmi_register_watchdog()
1047 timeout = old_timeout; in ipmi_register_watchdog()
1115 /* If we are not expecting a timeout, ignore it. */ in ipmi_nmi()
1127 /* On some machines, the heartbeat will give in ipmi_nmi()
1128 an error and not work unless we re-enable in ipmi_nmi()
1132 nmi_panic(regs, "pre-timeout"); in ipmi_nmi()
1155 reset if it hangs, but only if the watchdog in wdog_reboot_handler()
1157 if (timeout < 120) in wdog_reboot_handler()
1158 timeout = 120; in wdog_reboot_handler()
1197 if (strcmp(inval, "reset") == 0) in action_op()
1206 return -EINVAL; in action_op()
1230 return -EINVAL; in preaction_op()
1250 return -EINVAL; in preop_op()
1289 action_op("reset", NULL); in ipmi_wdog_init()
1290 pr_info("Unknown action '%s', defaulting to reset\n", action); in ipmi_wdog_init()