mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: Intel: avs: Access path components under lock
commitd849996f74upstream. Path and its components should be accessed under lock to prevent problems with one thread modifying them while other tries to read. Fixes:c8c960c109("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6ae9cf40b4
commit
ad72cb5899
@@ -173,6 +173,7 @@ static bool apl_lp_streaming(struct avs_dev *adev)
|
|||||||
{
|
{
|
||||||
struct avs_path *path;
|
struct avs_path *path;
|
||||||
|
|
||||||
|
spin_lock(&adev->path_list_lock);
|
||||||
/* Any gateway without buffer allocated in LP area disqualifies D0IX. */
|
/* Any gateway without buffer allocated in LP area disqualifies D0IX. */
|
||||||
list_for_each_entry(path, &adev->path_list, node) {
|
list_for_each_entry(path, &adev->path_list, node) {
|
||||||
struct avs_path_pipeline *ppl;
|
struct avs_path_pipeline *ppl;
|
||||||
@@ -192,11 +193,14 @@ static bool apl_lp_streaming(struct avs_dev *adev)
|
|||||||
if (cfg->copier.dma_type == INVALID_OBJECT_ID)
|
if (cfg->copier.dma_type == INVALID_OBJECT_ID)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!mod->gtw_attrs.lp_buffer_alloc)
|
if (!mod->gtw_attrs.lp_buffer_alloc) {
|
||||||
|
spin_unlock(&adev->path_list_lock);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
spin_unlock(&adev->path_list_lock);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user