ASoC: meson: axg-fifo: use threaded irq to check periods
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 26 Apr 2024 15:29:38 +0000 (17:29 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Apr 2024 14:48:48 +0000 (23:48 +0900)
commitb11d26660dff8d7430892008616452dc8e5fb0f3
tree919b0dbf43c3d1f8a7ecd6a69fd5e5c0b9d9a137
parentbda16500dd0b05e2e047093b36cbe0873c95aeae
ASoC: meson: axg-fifo: use threaded irq to check periods

With the AXG audio subsystem, there is a possible random channel shift on
TDM capture, when the slot number per lane is more than 2, and there is
more than one lane used.

The problem has been there since the introduction of the axg audio support
but such scenario is pretty uncommon. This is why there is no loud
complains about the problem.

Solving the problem require to make the links non-atomic and use the
trigger() callback to start FEs and BEs in the appropriate order.

This was tried in the past and reverted because it caused the block irq to
sleep while atomic. However, instead of reverting, the solution is to call
snd_pcm_period_elapsed() in a non atomic context.

Use the bottom half of a threaded IRQ to do so.

Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20240426152946.3078805-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/axg-fifo.c