diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2016-01-12 09:12:00 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2016-01-12 09:12:00 +0000 |
commit | 2869555f7c274849ef8c30c41c56981c5ef86671 (patch) | |
tree | 2c4a9c6b960a8f126b37caff94c38fe1b538729d /sys/dev/ipmi.c | |
parent | d8bf7832c5513cf3e0f1c1f5c359bca3cd7d51c2 (diff) |
Use task to execute watchdog tickle.
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r-- | sys/dev/ipmi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c index b43cf8f75fe..3fc7759410c 100644 --- a/sys/dev/ipmi.c +++ b/sys/dev/ipmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmi.c,v 1.88 2016/01/12 07:43:05 uebayasi Exp $ */ +/* $OpenBSD: ipmi.c,v 1.89 2016/01/12 09:11:59 uebayasi Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave @@ -36,6 +36,7 @@ #include <sys/sensors.h> #include <sys/malloc.h> #include <sys/kthread.h> +#include <sys/task.h> #include <machine/bus.h> #include <machine/intr.h> @@ -1724,6 +1725,7 @@ ipmi_attach(struct device *parent, struct device *self, void *aux) /* Setup Watchdog timer */ sc->sc_wdog_period = 0; + task_set(&sc->sc_wdog_tickle_task, ipmi_watchdog_tickle, sc); wdog_register(ipmi_watchdog, sc); /* lock around read_sensor so that no one messes with the bmc regs */ @@ -1757,7 +1759,14 @@ ipmi_watchdog(void *arg, int period) if (sc->sc_wdog_period == period) { if (period != 0) { - ipmi_watchdog_tickle(sc); + struct task *t; + int res; + + t = &sc->sc_wdog_tickle_task; + res = task_del(systq, t); + KASSERT(res == 0); + res = task_add(systq, t); + KASSERT(res == 1); } return (period); } |