diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2020-07-15 11:33:13 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2020-07-15 11:33:13 +0000 |
commit | c76181738a2a65481c6c32f004dc4d0965f49e09 (patch) | |
tree | 5f3a4ae12f048c4c574ea03be4541fbd288ba81a /sys/dev/fdt | |
parent | 471f25e1cb99ab2dd9b8707bdf84d1edd151c1e6 (diff) |
Run the sxitemp(4) at IPL_SOFTCLOCK instead of IPL_VM. Prevents "panic:
mtx ...: locking against myself" on Orange Pi Zero.
Analysis by patrick@:
"The thermal sensor framework uses its own taskq with IPL_SOFTCLOCK.
sxitemp(4) calls thermal_sensor_update() from interrupt context, and
sxitemp(4) is using IPL_VM (memory allocation?!) for its interrupt.
IPL_VM is obviously higher than IPL_SOFTCLOCK, so it ends up being able
to interrupt the taskq. Even though we're in msleep_nsec, I think we
have *not yet* given up the mutex, that we are holding while looking for
more work, only releasing it while sleeping.
Thus, the interrupt runs task_add(), which tries to grab the taskq's
mutex, even though the taskq already holds it!"
ok patrick@ kettenis@
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r-- | sys/dev/fdt/sxitemp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fdt/sxitemp.c b/sys/dev/fdt/sxitemp.c index a0a819c98df..19ff0d05f6c 100644 --- a/sys/dev/fdt/sxitemp.c +++ b/sys/dev/fdt/sxitemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxitemp.c,v 1.7 2020/01/23 23:10:04 kettenis Exp $ */ +/* $OpenBSD: sxitemp.c,v 1.8 2020/07/15 11:33:12 dtucker Exp $ */ /* * Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org> * @@ -131,7 +131,7 @@ sxitemp_attach(struct device *parent, struct device *self, void *aux) return; } - sc->sc_ih = fdt_intr_establish(faa->fa_node, IPL_VM, + sc->sc_ih = fdt_intr_establish(faa->fa_node, IPL_SOFTCLOCK, sxitemp_intr, sc, sc->sc_dev.dv_xname); if (sc->sc_ih == NULL) { printf(": can't establish interrupt\n"); |