summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/sst-firmware.c
diff options
context:
space:
mode:
authorJie Yang2014-10-30 14:21:52 +0100
committerMark Brown2014-10-30 14:41:22 +0100
commit35c0a8c0178ad3f6f14e1dd76f0317156deaae51 (patch)
treeed180b036ce62e8a783d1faa59b26050cba4d1ac /sound/soc/intel/sst-firmware.c
parentASoC: Intel: Add PM support to HSW/BDW PCM driver (diff)
downloadkernel-qcow2-linux-35c0a8c0178ad3f6f14e1dd76f0317156deaae51.tar.gz
kernel-qcow2-linux-35c0a8c0178ad3f6f14e1dd76f0317156deaae51.tar.xz
kernel-qcow2-linux-35c0a8c0178ad3f6f14e1dd76f0317156deaae51.zip
ASoC: Intel: Fix block is enabled multiple times issue
During FW parsing and loading, block_list_prepare() may be called for each raw data block copying and this may made the hsw_block_enable() called mutiple times, which increase block->users many times. The result of this is hsw_block_disable() can't power gated the related block when trying to free the blocks during suspend, and the power gating status also confused. Here check the block user status, only calling enable() for those blocks who has no user yet. Remember that this works correctlly on current case, where there are enough SRAM memory so different module won't share a memory block. For further usage, we may need restructure the struct sst_mem_block to save the module list who is using it. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/sst-firmware.c')
-rw-r--r--sound/soc/intel/sst-firmware.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index 35788ad4087e..c451398b058c 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -149,7 +149,7 @@ static int block_list_prepare(struct sst_dsp *dsp,
/* enable each block so that's it'e ready for data */
list_for_each_entry(block, block_list, module_list) {
- if (block->ops && block->ops->enable) {
+ if (block->ops && block->ops->enable && !block->users) {
ret = block->ops->enable(block);
if (ret < 0) {
dev_err(dsp->dev,