[alsa-devel] [PATCH v4] ASoC: soc-compress: Cancel delayed power down if needed

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Mar 20 11:25:44 CET 2013

On Mon, Mar 11, 2013 at 09:25:26AM +0000, Charles Keepax wrote:

Sorry about the delay here, I had been waiting for review from Vinod.

>  	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
> @@ -220,6 +221,10 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
>  			goto out;
>  	}
> +	/* cancel any delayed stream shutdown that is pending */
> +	rtd->pop_wait = 0;
> +	cancel_delayed_work_sync(&rtd->delayed_work);
> +

The work here uses the pcm mutex but the cancel is done with the mutex
held.  We need to either cancel outside the lock or just ensure that the
work doesn't do anything if we have run (which it looks like the
pop_wait flag actually does so we could probably just use a non-sync
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130320/24d5d501/attachment.sig>

More information about the Alsa-devel mailing list