Page MenuHomeFreeBSD

sound: Create a dsp_close() helper function
ClosedPublic

Authored by christos on Apr 12 2025, 8:13 PM.
Tags
None
Referenced Files
F153185612: D49805.id153588.diff
Sun, Apr 19, 4:30 PM
F153185535: D49805.id153588.diff
Sun, Apr 19, 4:29 PM
Unknown Object (File)
Sat, Apr 18, 11:55 AM
Unknown Object (File)
Sat, Apr 18, 7:30 AM
Unknown Object (File)
Sat, Apr 18, 2:07 AM
Unknown Object (File)
Thu, Apr 16, 2:08 PM
Unknown Object (File)
Sun, Apr 12, 11:31 PM
Unknown Object (File)
Tue, Apr 7, 9:14 PM
Subscribers

Details

Summary

Needed by follow-up patch.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Apr 13 2025, 4:02 PM
sys/dev/sound/pcm/dsp.c
268

So where are these non-NULL checks in the new code?

sys/dev/sound/pcm/dsp.c
268

At the very beginning of dsp_close_chan().

sys/dev/sound/pcm/dsp.c
268

Are the values of priv->{rd,wr}ch stable? You are now checking for their non-NULL after priv->sc acquire.

sys/dev/sound/pcm/dsp.c
268

Primary (i.e., non-vchan) channels are destroyed during detach (see pcm_killchans()), and vchans in dsp_close() (see vchan_destroy()). So I think it's safe to leave the check as is. If we're detaching, we'll catch that a few lines below and bail-out anyway, and for vchans, well, we destroy them here only.

This revision was automatically updated to reflect the committed changes.