HomeFreeBSD

sound: Move sysctl and /dev/dspX creation to pcm_setstatus()

Description

sound: Move sysctl and /dev/dspX creation to pcm_setstatus()

Create the sysctl and /dev/dsp* nodes in pcm_setstatus(), which is
responsible for finalizing the device initialization, instead of doing
this in the middle of the initialization.

For the sysctl creation specifically, move them into pcm_sysinit(),
since this is where we create the rest of the sysctl nodes anyway.

A side effect of this change is, that we avoid the possibility of racing
in between pcm_register() and pcm_setstatus() by accessing /dev/dspX or
the sysctls within that window.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D47322

(cherry picked from commit 66f3eb14e955d3917f817ff346d33d839679c2cf)

Details

Provenance
christosAuthored on Sun, Nov 3, 7:02 PM
Reviewer
dev_submerge.ch
Differential Revision
D47322: sound: Move sysctl and /dev/dspX creation to pcm_setstatus()
Parents
rG3dace161c237: sound: Retire pcm_veto_load
Branches
Unknown
Tags
Unknown