[alsa-devel] [PATCH 26/29] ALSA: oxfw: Add support AMDTP in-stream

Clemens Ladisch clemens at ladisch.de
Sun Nov 16 22:21:08 CET 2014


Takashi Sakamoto wrote:
> +++ b/sound/firewire/oxfw/oxfw-stream.c
> +int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw,
> +				  struct amdtp_stream *stream,
> +				  unsigned int rate, unsigned int pcm_channels)
> +{
> ...
> +	if (atomic_read(substreams) == 0)
> +		goto end;
> +
>  	mutex_lock(&oxfw->mutex);

What happens if hw_free is called between the calls to atomic_read() and
mutex_lock()?

And why are the substreams counters atomic?
Can't they just be normal variables accessed from inside the mutex?


Regards,
Clemens


More information about the Alsa-devel mailing list