On Thu, 14 Jun 2018 15:52:54 +0200
Martin Pieuchot <[email protected]> wrote:
> The problem is because you have an interrupt handler trying to grab the
> KERNEL_LOCK().  I'd suggest using IPL_MPFLOOR instead of IPL_NONE when
> initializing the mutex.

Thanks.  This also solved the problem.

ok?

Use IPL_MPFLOOR for mutex to prevent a interrupt which requires KERNEL_LOCK().

diff from fukaumi at soum.co.jp

Index: sys/dev/ipmi.c
===================================================================
RCS file: /var/cvs/openbsd/src/sys/dev/ipmi.c,v
retrieving revision 1.101
diff -u -p -r1.101 ipmi.c
--- sys/dev/ipmi.c      13 Apr 2018 05:33:38 -0000      1.101
+++ sys/dev/ipmi.c      15 Jun 2018 09:48:28 -0000
@@ -1653,7 +1653,7 @@ ipmi_match(struct device *parent, void *
 
        /* XXX local softc is wrong wrong wrong */
        sc = malloc(sizeof(*sc), M_TEMP, M_WAITOK | M_ZERO);
-       mtx_init(&sc->sc_cmd_mtx, IPL_NONE);
+       mtx_init(&sc->sc_cmd_mtx, IPL_MPFLOOR);
        strlcpy(sc->sc_dev.dv_xname, "ipmi0", sizeof(sc->sc_dev.dv_xname));
 
        /* Map registers */
@@ -1726,7 +1726,7 @@ ipmi_attach(struct device *parent, struc
        c->c_ccode = -1;
 
        sc->sc_cmd_taskq = taskq_create("ipmicmd", 1, IPL_NONE, TASKQ_MPSAFE);
-       mtx_init(&sc->sc_cmd_mtx, IPL_NONE);
+       mtx_init(&sc->sc_cmd_mtx, IPL_MPFLOOR);
 }
 
 int

Reply via email to