From patchwork Wed Aug 24 12:33:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 9298521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB4E4607D0 for ; Thu, 25 Aug 2016 01:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5A9E29090 for ; Thu, 25 Aug 2016 01:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B90AA29130; Thu, 25 Aug 2016 01:01:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 008CD29090 for ; Thu, 25 Aug 2016 01:01:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4781E267346; Thu, 25 Aug 2016 03:01:24 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B726B2674BE; Wed, 24 Aug 2016 21:20:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 582A92674B3; Wed, 24 Aug 2016 21:20:25 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 0EF5A2675A0 for ; Wed, 24 Aug 2016 14:25:36 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 24 Aug 2016 05:25:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,570,1464678000"; d="scan'208";a="752906423" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by FMSMGA003.fm.intel.com with ESMTP; 24 Aug 2016 05:25:34 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Wed, 24 Aug 2016 18:03:16 +0530 Message-Id: <1472042001-9582-5-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472042001-9582-1-git-send-email-vinod.koul@intel.com> References: <1472042001-9582-1-git-send-email-vinod.koul@intel.com> Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com, Dharageswari R , broonie@kernel.org, Vinod Koul Subject: [alsa-devel] [PATCH 4/9] ASoC: Intel: Skylake: Unload all the loadable modules X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dharageswari R There could be more than one loadable module in a pipeline. So unload all modules whilst parsing the list. Signed-off-by: Dharageswari R Signed-off-by: Vinod Koul --- sound/soc/intel/skylake/skl-topology.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 6bceab8f0bac..2d475b720963 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -523,6 +523,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe) static int skl_tplg_unload_pipe_modules(struct skl_sst *ctx, struct skl_pipe *pipe) { + int ret; struct skl_pipe_module *w_module = NULL; struct skl_module_cfg *mconfig = NULL; @@ -530,9 +531,12 @@ static int skl_tplg_unload_pipe_modules(struct skl_sst *ctx, mconfig = w_module->w->priv; if (mconfig->is_loadable && ctx->dsp->fw_ops.unload_mod && - mconfig->m_state > SKL_MODULE_UNINIT) - return ctx->dsp->fw_ops.unload_mod(ctx->dsp, + mconfig->m_state > SKL_MODULE_UNINIT) { + ret = ctx->dsp->fw_ops.unload_mod(ctx->dsp, mconfig->id.module_id); + if (ret < 0) + return -EIO; + } } /* no modules to unload in this path, so return */