diff options
author | Vinod Koul <vinod.koul@intel.com> | 2017-03-24 13:40:28 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-03-29 07:53:27 -0400 |
commit | f7ea77772dfaa404ac0bcdea5c262c24e8b860db (patch) | |
tree | f56b42436ff036346cf3511003b5d0f9d0bac6dc | |
parent | e59ed0875b0681ebd1e5062b739742f98f24274c (diff) |
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 <vinod.koul@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/skylake/skl-sst.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) | |||
417 | dev_err(ctx->dev, "Module bad usage cnt!:%d\n", usage_cnt); | 417 | dev_err(ctx->dev, "Module bad usage cnt!:%d\n", usage_cnt); |
418 | return -EIO; | 418 | return -EIO; |
419 | } | 419 | } |
420 | |||
421 | /* if module is used by others return, no need to unload */ | ||
422 | if (usage_cnt > 0) | ||
423 | return 0; | ||
424 | |||
420 | ret = skl_ipc_unload_modules(&skl->ipc, | 425 | ret = skl_ipc_unload_modules(&skl->ipc, |
421 | SKL_NUM_MODULES, &mod_id); | 426 | SKL_NUM_MODULES, &mod_id); |
422 | if (ret < 0) { | 427 | if (ret < 0) { |