From: Vinod Koul Date: Fri, 24 Mar 2017 17:40:28 +0000 (+0530) Subject: ASoC: Intel: Skylake: Don't unload module when in use X-Git-Tag: v4.12-rc1~115^2^2~14^2~25 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f7ea77772dfaa404ac0bcdea5c262c24e8b860db;p=karo-tx-linux.git ASoC: Intel: Skylake: Don't unload module when in use A module may have multiple instances in DSP, so unload only when usage count is zero. Signed-off-by: Vinod Koul Signed-off-by: Jeeja KP Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c index 39d4aaac73bf..539529729e3f 100644 --- a/sound/soc/intel/skylake/skl-sst.c +++ b/sound/soc/intel/skylake/skl-sst.c @@ -417,6 +417,11 @@ static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id) dev_err(ctx->dev, "Module bad usage cnt!:%d\n", usage_cnt); return -EIO; } + + /* if module is used by others return, no need to unload */ + if (usage_cnt > 0) + return 0; + ret = skl_ipc_unload_modules(&skl->ipc, SKL_NUM_MODULES, &mod_id); if (ret < 0) {