Don't grab audio_lock in filt_midi{read,write} if NOTE_SUBMIT is set.
authorratchov <ratchov@openbsd.org>
Fri, 29 Oct 2021 13:24:50 +0000 (13:24 +0000)
committerratchov <ratchov@openbsd.org>
Fri, 29 Oct 2021 13:24:50 +0000 (13:24 +0000)
commited1204be1886f82657c7fa3d1d0091835fe52e73
tree7d485c91237eb5477e2197399762fcf4d12418bd
parent9495cd8ad754dc9d0ef2a046d5bce26acaf0392e
Don't grab audio_lock in filt_midi{read,write} if NOTE_SUBMIT is set.

Fixes panics caused by attempts to grab audio_lock twice in the
interrupt code path: once in the low-lever interrupt handler and once
in selwakeup()

This is exactly how audio(4) handles this problem.

ok mpi
sys/dev/midi.c