Page MenuHomeFreeBSD

sound: Use snddev_info->lock in place of snd_mixer->lock
Needs ReviewPublic

Authored by christos on Fri, Aug 21, 12:44 PM.
Tags
None
Referenced Files
F167407879: D59074.id184640.diff
Fri, Aug 21, 2:36 PM
F167400697: D59074.id184640.diff
Fri, Aug 21, 1:40 PM
F167397382: D59074.diff
Fri, Aug 21, 1:15 PM
Subscribers

Details

Reviewers
markj
emaste
kib
Summary

snd_mixer and snddev_info have a 1:1 relationship. Now that snd_mixer is
embedded into snddev_info, it makes even more sense for both to share
the PCM lock. The only exceptions to this are MIXER_TYPE_SECONDARY
mixers, which still retain a private lock (snd_mixer->priv_lock),
because they are attached to the device driver, and not snddev_info.
Only snd_emu10kx(4) uses a secondary mixer.

A side-effect of this is that the MIXER_SET_LOCK()/MIXER_SET_UNLOCK()
mess goes away. These macros were used in the mixer_set*() functions to
drop the mixer lock if the driver is Giant-locked and the function can
sleep inside MIXER_SET*() methods, and to avoid an LOR before locking
PCM to guard channel list traversal.

Since mixers now use the PCM lock, drop the channel lock in
chn_syncstate() before calling mix_get(), to avoid an LOR. These lines
were actually already commented out for years.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75939
Build 72822: arc lint + arc unit