From: Takashi Iwai Subject: Re: [PATCH] ASoC: Intel: fix broadwell module removing failed issue Date: Thu, 28 May 2015 17:09:40 +0200 Message-ID: References: <1432793658-9463-1-git-send-email-yang.jie@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7ABE12604BE for ; Thu, 28 May 2015 17:09:41 +0200 (CEST) In-Reply-To: <1432793658-9463-1-git-send-email-yang.jie@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Jie Yang Cc: Liam Girdwood , alsa-devel@alsa-project.org, broonie@kernel.org, liam.r.girdwood@intel.com List-Id: alsa-devel@alsa-project.org At Thu, 28 May 2015 14:14:18 +0800, Jie Yang wrote: > > From: Liam Girdwood > > 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 > Signed-off-by: Jie Yang > --- > 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 >