summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2016-01-12 09:12:00 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2016-01-12 09:12:00 +0000
commit2869555f7c274849ef8c30c41c56981c5ef86671 (patch)
tree2c4a9c6b960a8f126b37caff94c38fe1b538729d /sys
parentd8bf7832c5513cf3e0f1c1f5c359bca3cd7d51c2 (diff)
Use task to execute watchdog tickle.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ipmi.c13
-rw-r--r--sys/dev/ipmivar.h4
2 files changed, 14 insertions, 3 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);
}
diff --git a/sys/dev/ipmivar.h b/sys/dev/ipmivar.h
index d7d29133464..04b7126fd8f 100644
--- a/sys/dev/ipmivar.h
+++ b/sys/dev/ipmivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmivar.h,v 1.25 2016/01/11 14:39:23 uebayasi Exp $ */
+/* $OpenBSD: ipmivar.h,v 1.26 2016/01/12 09:11:59 uebayasi Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -33,6 +33,7 @@
#include <sys/timeout.h>
#include <sys/rwlock.h>
#include <sys/sensors.h>
+#include <sys/task.h>
#define IPMI_IF_KCS 1
#define IPMI_IF_SMIC 2
@@ -113,6 +114,7 @@ struct ipmi_softc {
struct ipmi_cmd *sc_cmd;
int sc_wdog_period;
+ struct task sc_wdog_tickle_task;
struct ipmi_thread *sc_thread;