ASoC: fsl_esai: Add spin lock to protect reset, stop and start
authorShengjiu Wang <shengjiu.wang@nxp.com>
Mon, 28 Oct 2019 09:11:05 +0000 (17:11 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 28 Oct 2019 13:13:37 +0000 (13:13 +0000)
commit35dac627471938eda89fa39ee4ead1f7667e0f57
treec5639e0c56ad99ebca48d30cf829a3282c225958
parentb39eb1e250c32c695a780f1814086f2bfa0fb593
ASoC: fsl_esai: Add spin lock to protect reset, stop and start

xrun may happen at the end of stream, the
trigger->fsl_esai_trigger_stop maybe called in the middle of
fsl_esai_hw_reset, this may cause esai in wrong state
after stop, and there may be endless xrun interrupt.

This issue may also happen with trigger->fsl_esai_trigger_start.

So Add spin lock to lock those functions.

Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/52e92c4221a83e39a84a6cd92fc3d5479b44894c.1572252321.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_esai.c