Skip to content

Commit

Permalink
ASoC: Intel: Skylake: Don't unload module when in use
Browse files Browse the repository at this point in the history
A module may have multiple instances in DSP, so unload only when usage
count is zero.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vinod Koul authored and Mark Brown committed Mar 29, 2017
1 parent e59ed08 commit f7ea777
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/intel/skylake/skl-sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f7ea777

Please sign in to comment.