diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2023-01-30 15:06:42 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-01-30 21:36:21 +0300 |
commit | d3681df44e856aab523a6eb7ba15b5e41efcbb1c (patch) | |
tree | 63ed98e9eb70bcc2c83a0984d0f68e7ad1d98100 /net/smc | |
parent | a4c4161d6eae3ef5f486d1638ef452d9bc1376b0 (diff) | |
download | linux-d3681df44e856aab523a6eb7ba15b5e41efcbb1c.tar.xz |
ASoC: mchp-spdifrx: fix controls that works with completion mechanism
Channel status get and channel subcode get controls relies on data
returned by controls when certain IRQs are raised. To achieve that
completions are used b/w controls and interrupt service routine. The
concurrent accesses to these controls are protected by
struct snd_card::controls_rwsem.
Issues identified:
- reinit_completion() may be called while waiting for completion
which should be avoided
- in case of multiple threads waiting, the complete() call in interrupt
will signal only one waiting thread per interrupt which may lead to
timeout for the others
- in case of channel status get as the CSC interrupt is not refcounted
ISR may disable interrupt for threads that were just enabled it.
To solve these the access to controls were protected by a mutex. Along
with this there is no need for spinlock to protect the software cache
reads/updates b/w controls and ISR as the update is happening only when
requested from control, and only one reader can reach the control.
Fixes: ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'net/smc')
0 files changed, 0 insertions, 0 deletions