Lock around uses of devclass_get_maxunit() and modification of global
variables in sysctl handlers.
While here, replace leftover CTLFLAG_NEEDGIANTs with CTLFLAG_MPSAFE.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Differential D46700
sound: Use bus_topo_lock() where needed christos on Thu, Sep 19, 11:39 AM. Authored by Tags None Referenced Files
Subscribers
Details
Lock around uses of devclass_get_maxunit() and modification of global While here, replace leftover CTLFLAG_NEEDGIANTs with CTLFLAG_MPSAFE. Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment Actions Anything which is calling devclass_get_maxunit() should be holding bus_topo_lock, AKA, Giant. This change is incomplete. Comment Actions Quibble: Giant is a detail now that consumers need not know. So removing NEEDSGIANT is good, so long as one explicitly uses bus_topo_lock() around references to devclass_get_maxunit the whole loop in sysctl_hw_snd_maxautovchans. I should add asserts to devclass_get_maxunit()... It's not strictly required for it, but to use the results, one must hold the topo lock.
Comment Actions Lock only around uses of devclass_get_maxunit(). Will write a separate patches
|