[alsa-devel] [PATCH] ASoC: Intel: fix broadwell module removing failed issue

Takashi Iwai tiwai at suse.de
Thu May 28 17:09:40 CEST 2015


At Thu, 28 May 2015 14:14:18 +0800,
Jie Yang wrote:
> 
> From: Liam Girdwood <liam.r.girdwood at linux.intel.com>
> 
> In haswell-pcm module unloading, we can't free runtime modules
> directly, for they may be already freed in runtime suspend.
> 
> Here add executing suspend call to unload runtime modules, only
> for status not equal to RPM_SUSPEND, to fix broadwell module
> removing failed issue.

What if a kernel is built without PM support?  (Practically seen, it's
never any serious problem, though.)


Takashi

> 
> Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
> Signed-off-by: Jie Yang <yang.jie at intel.com>
> ---
>  sound/soc/intel/haswell/sst-haswell-pcm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/haswell/sst-haswell-pcm.c b/sound/soc/intel/haswell/sst-haswell-pcm.c
> index 23ae040..bd96629 100644
> --- a/sound/soc/intel/haswell/sst-haswell-pcm.c
> +++ b/sound/soc/intel/haswell/sst-haswell-pcm.c
> @@ -1118,8 +1118,10 @@ static int hsw_pcm_remove(struct snd_soc_platform *platform)
>  		snd_soc_platform_get_drvdata(platform);
>  	int i;
>  
> +	/* execute a suspend call to unload all FW resources */
> +	if (!pm_runtime_status_suspended(platform->dev))
> +		pm_runtime_put_sync_suspend(platform->dev);
>  	pm_runtime_disable(platform->dev);
> -	hsw_pcm_free_modules(priv_data);
>  
>  	for (i = 0; i < ARRAY_SIZE(hsw_dais); i++) {
>  		if (hsw_dais[i].playback.channels_min)
> -- 
> 1.9.1
> 


More information about the Alsa-devel mailing list