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
F169113228: D59074.id.diff
Mon, Aug 31, 11:04 AM
F169051989: D59074.diff
Mon, Aug 31, 6:28 AM
F169022716: D59074.diff
Mon, Aug 31, 3:43 AM
F168993150: D59074.id184640.diff
Mon, Aug 31, 2:11 AM
F168959032: D59074.diff
Sun, Aug 30, 11:18 PM
Unknown Object (File)
Sun, Aug 30, 3:40 AM
Unknown Object (File)
Sat, Aug 29, 3:18 PM
Unknown Object (File)
Sat, Aug 29, 1:45 AM
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