[alsa-devel] [PATCH RFC v2 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders

Mark Brown broonie at kernel.org
Fri Aug 14 21:25:21 CEST 2015


On Tue, May 26, 2015 at 09:59:07PM +0300, Jyri Sarha wrote:

> +
> +	mutex_lock(&hcp->current_stream_lock);
> +	if (hcp->current_stream && hcp->current_stream->runtime &&
> +	    snd_pcm_running(hcp->current_stream)) {
> +		dev_info(dev, "HDMI audio playback aborted\n");

Does this really need to be dev_info()?

> +	if (hcp->hcd.ops->get_eld) {
> +		hcp->eld = hcp->hcd.ops->get_eld(hcp->hcd.dev);
> +
> +		/* Call snd_pcm_hw_constraint_eld here */
> +	}

...

> +	dev_dbg(dai->dev, "%s()\n", __func__);
> +
> +	mutex_lock(&hcp->current_stream_lock);
> +	BUG_ON(hcp->current_stream != substream);
> +	hcp->current_stream = NULL;
> +	mutex_unlock(&hcp->current_stream_lock);
> +
> +	hcp->hcd.ops->audio_shutdown(hcp->hcd.dev);

Shouldn't the callback be in or before the lock?  Otherwise we could
potentially race with starting a new stream.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150814/3b3328a5/attachment-0001.sig>


More information about the Alsa-devel mailing list