From 2869555f7c274849ef8c30c41c56981c5ef86671 Mon Sep 17 00:00:00 2001 From: Masao Uebayashi Date: Tue, 12 Jan 2016 09:12:00 +0000 Subject: Use task to execute watchdog tickle. --- sys/dev/ipmi.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys/dev/ipmi.c') 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 #include #include +#include #include #include @@ -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); } -- cgit v1.2.3