Module Name: src Committed By: riastradh Date: Sun Oct 10 11:20:29 UTC 2021
Modified Files: src/sys/dev/audio: audio.c Log Message: audio(9): Call hw_if->getdev without sc_lock. Holding sc_lock is not necessary -- I reviewed all ~70 cases in-tree, and none of them rely on state protected by sc_lock. Essentially everything just copies from static data or data initialized at attach time. (Exceptions: tms320av110.c issues a bus_space_read_1, but I don't see any reason why that needs to be serialized; and uaudio.c reads from sc_dying, but that's not necessary and also not protected by sc_lock anyway.) Holding sc_lock is harmful because at least hdafg(4) can trigger module autoload that leads to pserialize_perform, which waits for logic to run at softint serial on all CPUs; at the same time, audio_softintr_rd/wr run at softint serial and take sc_lock, so this leads to deadlock. To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/dev/audio/audio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.