MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Details
- Reviewers
markj emaste kib - Commits
- rG91dec580726f: sound: Document the locking protocol
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Seems ok. It would be nicer to annotate individual fields like we do for other structures, see struct vm_page for instance.
| sys/dev/sound/pcm/sound.h | ||
|---|---|---|
| 164 | It's also used for synchronizing with device teardown, I believe. | |
| 182 | Isn't it illegal to hold multiple channel locks at the same time? If not, then it would be nice to rework chn_resizebuf() to avoid dropping the (child) channel lock part-way through. BTW, that function still has some bugs in that it doesn't properly roll back state after an error, e.g., the CHN_F_HAS_SIZE flag. | |
I will add a TODO for that.
| sys/dev/sound/pcm/sound.h | ||
|---|---|---|
| 182 | It is not illegal, no. There are many places where both channel locks are held, see dsp_close() for instance. The protocol here already states this, we just want to make sure the parent channels are locked before the child ones. I agree with the chn_resizebuf() changes. | |