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)
committerMark Brown <broonie@kernel.org>
Thu, 9 Feb 2023 14:03:28 +0000 (14:03 +0000)
commit84222ef54bfd8f043c23c8603fd5257a64b00780
tree271f3519031b7ac4fea408812704ea15cf2bd6c9
parentc2ac3aec474da0455df79c4a182f19687bc98d1d
ASoC: qcom: q6apm-dai: fix race condition while updating the position pointer

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>
sound/soc/qcom/qdsp6/q6apm-dai.c