ASoC: fsl_audmix: Add spin lock to protect tdms
authorShengjiu Wang <shengjiu.wang@nxp.com>
Mon, 11 Nov 2019 07:50:48 +0000 (15:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 18:56:14 +0000 (19:56 +0100)
commita11fab7708329fd902d721fe8f2b1b628da35de9
treec9b3cf934910cb8ada71dbbc0880c502844f6c58
parent9ae0611f0c55178aea77f39ee07d539556d7c6eb
ASoC: fsl_audmix: Add spin lock to protect tdms

commit fe965096c9495ddcf78ec163348105e2baf8d185 upstream.

Audmix support two substream, When two substream start
to run, the trigger function may be called by two substream
in same time, that the priv->tdms may be updated wrongly.

The expected priv->tdms is 0x3, but sometimes the
result is 0x2, or 0x1.

Fixes: be1df61cf06e ("ASoC: fsl: Add Audio Mixer CPU DAI driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1e706afe53fdd1fbbbc79277c48a98f8416ba873.1573458378.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/fsl/fsl_audmix.c
sound/soc/fsl/fsl_audmix.h