[alsa-devel] [PATCH 1/5] ASoC: Hold runtime PM references to components of active DAIs

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Dec 5 12:39:41 CET 2011


On Mon, Dec 05, 2011 at 10:01:07AM +0200, Peter Ujfalusi wrote:
> On 12/05/2011 02:01 AM, Mark Brown wrote:

> > +	pm_runtime_get_sync(cpu_dai->dev);
> > +	pm_runtime_get_sync(codec_dai->dev);
> > +	pm_runtime_get_sync(platform->dev);
> > +
> >  	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);

> I think it is better to move the pm_runtime_get_sync calls after the
> mutex_lock_nested() to be really safe (and to not change the way DAI
> drivers were handling the pm_runtime).

This increases the amount of time we are sitting with the pcm_mutex held
and I can't see a reason why we should need to do that.  If there is a
problem here I'd rather improve the drivers so that they can cope with
having the power management happening after the lock, the main reason
the drivers were doing this previously is that the lock happened to be
held by the caller.


More information about the Alsa-devel mailing list