android_kernel_xiaomi_sm8450/sound/core
Jai Luthra 072f6348c5 ALSA: dmaengine: Synchronize dma channel after drop()
[ Upstream commit e8343410ddf08fc36a9b9cc7c51a4e53a262d4c6 ]

Sometimes the stream may be stopped due to XRUN events, in which case
the userspace can call snd_pcm_drop() and snd_pcm_prepare() to stop and
start the stream again.

In these cases, we must wait for the DMA channel to synchronize before
marking the stream as prepared for playback, as the DMA channel gets
stopped by drop() without any synchronization. Make sure the ALSA core
synchronizes the DMA channel by adding a sync_stop() hook.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Link: https://lore.kernel.org/r/20240611-asoc_next-v3-1-fcfd84b12164@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-27 10:40:19 +02:00
..
oss ALSA: oss: avoid missing-prototype warnings 2023-06-09 10:30:12 +02:00
seq ALSA: seq: fix function cast warnings 2024-03-26 18:21:57 -04:00
compress_offload.c ALSA: compress_offload: remove redundant initialization 2020-09-03 09:26:27 +02:00
control_compat.c ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF 2023-01-14 10:16:52 +01:00
control.c ALSA: control: Use deferred fasync helper 2022-08-25 11:38:21 +02:00
ctljack.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
device.c ALSA: core: Add snd_device_get_state() helper 2020-03-23 18:09:19 +01:00
hrtimer.c ALSA: timer: Replace tasklet with work 2020-09-09 18:32:52 +02:00
hwdep_compat.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
hwdep.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
info_oss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
info.c ALSA: info: Fix potential deadlock at disconnection 2023-11-28 16:54:59 +00:00
init.c ALSA: core: Fix NULL module pointer assignment at card init 2024-06-16 13:31:59 +02:00
isadma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jack.c ALSA: jack: Fix mutex call in snd_jack_report() 2023-07-27 08:44:10 +02:00
Kconfig ALSA: control: Add verification for kctl accesses 2020-01-04 09:37:59 +01:00
Makefile ALSA: Drop leftover snd-rtctimer stuff from Makefile 2024-03-06 14:37:49 +00:00
memalloc.c ALSA: memalloc: Align buffer allocations in page size 2022-07-29 17:19:25 +02:00
memory.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
misc.c ALSA: core: Add async signal helpers 2022-08-25 11:38:20 +02:00
pcm_compat.c ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl 2023-09-19 12:20:21 +02:00
pcm_dmaengine.c ALSA: dmaengine: Synchronize dma channel after drop() 2024-07-27 10:40:19 +02:00
pcm_drm_eld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcm_iec958.c ALSA: core: pcm_iec958: fix kernel-doc 2020-07-07 10:22:33 +02:00
pcm_lib.c ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock 2022-04-08 14:39:53 +02:00
pcm_local.h ALSA: pcm: Call sync_stop at disconnection 2021-03-04 11:37:19 +01:00
pcm_memory.c ALSA: pcm: Fix potential data race at PCM memory allocation helpers 2023-08-30 16:23:11 +02:00
pcm_misc.c ALSA: pcm: Test for "silence" field in struct "pcm_format_data" 2022-04-20 09:23:27 +02:00
pcm_native.c ALSA: pcm: Set missing stop_operating flag at undoing trigger start 2023-01-14 10:15:38 +01:00
pcm_param_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm_timer.c ALSA: timer: Constify snd_timer_hardware definitions 2020-01-03 09:24:07 +01:00
pcm_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm.c ALSA: pcm: fix out-of-bounds in snd_pcm_state_names 2023-12-13 18:27:02 +01:00
rawmidi_compat.c ALSA: Avoid using timespec for struct snd_rawmidi_status 2019-12-11 22:06:16 +01:00
rawmidi.c ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() 2022-10-26 13:25:06 +02:00
seq_device.c ALSA: seq: Fix a potential UAF by wrong private_free call order 2021-10-20 11:44:57 +02:00
sgbuf.c ALSA: memalloc: Make SG-buffer helper usable for continuous buffer, too 2020-06-15 18:01:52 +02:00
sound_oss.c ALSA: oss: Fix potential deadlock at unregistration 2022-10-26 13:25:06 +02:00
sound.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer_compat.c ALSA: Avoid using timespec for struct snd_timer_tread 2019-12-13 11:25:57 +01:00
timer.c ALSA: timer: Set lower bound of start tick time 2024-06-16 13:32:30 +02:00
vmaster.c ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00