On Thu, Dec 09, 2021 at 09:02:07PM -0700, Theo de Raadt wrote: > > I think drivers, or maybe this can be done in higher-level subsystems, need > to be modified such that events get sent when a device is *actually ready*, > and the call from config_attach() should be deleted. >
For audio and MIDI, I think we're not very far from this. Currently, as soon as audio_attach() returns, both hardware and audio(4) internal structures are properly initialized. So all the audio_{open,read,write,ioctl,close}() interfaces are safe to call. What happens in higher layers is unclear to me? for instance, what needs to be done for open(2) to reach audioopen() with no races?