summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2020-07-15 11:33:12 +0000
committerdtucker <dtucker@openbsd.org>2020-07-15 11:33:12 +0000
commit24c7ba2abdd316c65b1fcc48a4d33a19e6d7eaac (patch)
tree14f224a25746c336905e3d74a16e4e4c05f0752b
parentRenumber after killing windows for choose-tree. (diff)
downloadwireguard-openbsd-24c7ba2abdd316c65b1fcc48a4d33a19e6d7eaac.tar.xz
wireguard-openbsd-24c7ba2abdd316c65b1fcc48a4d33a19e6d7eaac.zip
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@
-rw-r--r--sys/dev/fdt/sxitemp.c4
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");