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
Unknown Object (File)
Wed, Sep 9, 4:19 PM
Unknown Object (File)
Wed, Sep 9, 10:38 AM
Unknown Object (File)
Wed, Sep 9, 3:03 AM
Unknown Object (File)
Sun, Sep 6, 10:49 AM
Unknown Object (File)
Sun, Sep 6, 5:47 AM
Unknown Object (File)
Sat, Sep 5, 10:49 AM
Unknown Object (File)
Sat, Sep 5, 7:13 AM
Unknown Object (File)
Fri, Sep 4, 9:49 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