Re: [PATCH] ASoC: fsl_esai: Add spin lock to protect reset and stop

From: S.j. Wang <hidden>
Date: 2019-10-25 05:54:22
Also in: alsa-devel, lkml

Hi
On Wed, Oct 23, 2019 at 03:29:49PM +0800, Shengjiu Wang wrote:
quoted
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.
What about fsl_esai_trigger_start? It touches ESAI_xFCR_xFEN bit that is
being checked in the beginning of fsl_esai_hw_reset.

Could the scenario below be possible also?

1) ESAI TX starts
2) Xrun happens to TX
3) Starting fsl_esai_hw_reset (enabled[TX] = true; enabled[RX] = false)
4) ESAI RX starts
5) Finishing fsl_esai_hw_reset (enabled[RX] is still false)
Good catch, this may possible.  Will update in v2.

Best regards
Wang shengjiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help