Skip to content

Commit d849996

Browse files
Amadeusz Sławińskibroonie
authored andcommitted
ASoC: Intel: avs: Access path components under lock
Path and its components should be accessed under lock to prevent problems with one thread modifying them while other tries to read. Fixes: c8c960c ("ASoC: Intel: avs: APL-based platforms support") Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230519201711.4073845-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ff04437 commit d849996

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sound/soc/intel/avs/apl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ static bool apl_lp_streaming(struct avs_dev *adev)
169169
{
170170
struct avs_path *path;
171171

172+
spin_lock(&adev->path_list_lock);
172173
/* Any gateway without buffer allocated in LP area disqualifies D0IX. */
173174
list_for_each_entry(path, &adev->path_list, node) {
174175
struct avs_path_pipeline *ppl;
@@ -188,11 +189,14 @@ static bool apl_lp_streaming(struct avs_dev *adev)
188189
if (cfg->copier.dma_type == INVALID_OBJECT_ID)
189190
continue;
190191

191-
if (!mod->gtw_attrs.lp_buffer_alloc)
192+
if (!mod->gtw_attrs.lp_buffer_alloc) {
193+
spin_unlock(&adev->path_list_lock);
192194
return false;
195+
}
193196
}
194197
}
195198
}
199+
spin_unlock(&adev->path_list_lock);
196200

197201
return true;
198202
}

0 commit comments

Comments
 (0)