From: Liam Girdwood Date: Thu, 28 May 2015 06:14:18 +0000 (+0800) Subject: ASoC: Intel: fix broadwell module removing failed issue X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=01f202c7b4b40025f3ea4721c52e7f78545e3b07;p=deliverable%2Flinux.git ASoC: Intel: fix broadwell module removing failed issue 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. Signed-off-by: Liam Girdwood Signed-off-by: Jie Yang Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/haswell/sst-haswell-pcm.c b/sound/soc/intel/haswell/sst-haswell-pcm.c index 225c04c38e42..1557e37abe19 100644 --- a/sound/soc/intel/haswell/sst-haswell-pcm.c +++ b/sound/soc/intel/haswell/sst-haswell-pcm.c @@ -1103,8 +1103,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)