zephyr/drivers/audio
Andrzej Głąbek 8b391dc438 drivers: audio: dmic_nrfx_pdm: Fix a race condition in the driver
When the PAUSE or STOP command was triggered, the driver was first
requesting the PDM peripheral to stop by calling nrfx_pdm_stop() and
then it was setting a flag that was in turn checked in an interrupt
that was generated when the PDM actually stopped (what happens a moment
after the stop request is made). But that setting of the flag could get
preempted and the interrupt handler could get executed first causing
the stopping to be not handled properly and leaving the driver falsely
considering the peripheral as still active.
This commit reverses the order of these two operations to avoid
the described race condition.
Same sequence is corrected also in event_handler(), but this is
done only for consistency (it is in the interrupt handler itself
so there is no race possible in this case).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-18 12:14:07 +01:00
..
CMakeLists.txt drivers: dmic: remove old intel dmic driver 2022-07-25 13:14:49 -04:00
dmic_nrfx_pdm.c drivers: audio: dmic_nrfx_pdm: Fix a race condition in the driver 2023-01-18 12:14:07 +01:00
Kconfig drivers: dmic: remove old intel dmic driver 2022-07-25 13:14:49 -04:00
Kconfig.dmic_pdm_nrfx drivers: audio: Update Kconfig 2022-08-14 09:05:09 -05:00
Kconfig.mpxxdtyy drivers: audio: Update Kconfig 2022-08-14 09:05:09 -05:00
Kconfig.tlv320dac drivers: audio: Update Kconfig 2022-08-14 09:05:09 -05:00
mpxxdtyy-i2s.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
mpxxdtyy.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
mpxxdtyy.h includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
tlv320dac310x.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
tlv320dac310x.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00