]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ASoC: qcom: q6apm-dai: fix race condition while updating the position pointer
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 9 Feb 2023 12:28:00 +0000 (12:28 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:46 +0000 (16:46 +0100)
commit5fbb13cc0ae87497fcc48a1940df6a554879e078
treeb18753ef16118e628668714a40d5351ffdbd45a9
parent2cb19c2329054a6991d462bbb17efdad9d507f48
ASoC: qcom: q6apm-dai: fix race condition while updating the position pointer

BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 84222ef54bfd8f043c23c8603fd5257a64b00780 ]

It is noticed that the position pointer value seems to get a get corrupted
due to missing locking between updating and reading.

Fix this by adding a spinlock around the position pointer.

Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230209122806.18923-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
sound/soc/qcom/qdsp6/q6apm-dai.c