Page MenuHomeFreeBSD

sound: Busy devices before giving up the topology lock
Needs ReviewPublic

Authored by christos on Fri, Oct 9, 8:48 AM.
Tags
None
Referenced Files
F175306724: D60507.diff
Fri, Oct 9, 8:14 PM
F175287777: D60507.id189174.diff
Fri, Oct 9, 5:00 PM
F175280999: D60507.id189174.diff
Fri, Oct 9, 4:15 PM
F175279684: D60507.diff
Fri, Oct 9, 4:09 PM
F175275983: D60507.diff
Fri, Oct 9, 3:54 PM
F175249210: D60507.id189174.diff
Fri, Oct 9, 10:25 AM
F175245003: D60507.id189174.diff
Fri, Oct 9, 9:41 AM
F175244604: D60507.diff
Fri, Oct 9, 9:36 AM
Subscribers

Details

Reviewers
markj
emaste
kib
Summary

The SNDCTL_*INFO ioctls can report info about any device in the system,
not only the one they were issued on. Both the dsp and mixer dispatchers
unnecessarily busy the caller's device first. The caller's device is
kept alive anyway, until destroy_dev() drains the cdev threadcount.

Busying the wrong device also prevents the handlers from busying the one
they actually want to report info on, because this would recurse on the
sx whenever the two were the same, so they walk the channel lists under
PCM_LOCK instead.

Busy each device as it is being inspected, and give up the topology lock
once it is busied rather than holding it across the walks.

The vchan sysctls have the same problem. They look the device up under
the topology lock, drop it, and then busy the device, leaving a window
where the device can disappear. Busy it before dropping the lock there
too.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

Diff Detail

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