diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-11-17 11:53:06 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-11-20 21:39:54 +0300 |
commit | 1e850beea2781d30418743dd99250291cef37919 (patch) | |
tree | 7fb4b28d04c62f73191502c2ce3b30dac846db77 /sound/usb/format.h | |
parent | 0821fd77a1129cf4848d82d9275fb4e90e02edf8 (diff) | |
download | linux-1e850beea2781d30418743dd99250291cef37919.tar.xz |
ALSA: pcm: Add the support for sync-stop operation
The standard programming model of a PCM sound driver is to process
snd_pcm_period_elapsed() from an interrupt handler. When a running
stream is stopped, PCM core calls the trigger-STOP PCM ops, sets the
stream state to SETUP, and moves on to the next step. This is
performed in an atomic manner -- this could be called from the interrupt
context, after all.
The problem is that, if the stream goes further and reaches to the
CLOSE state immediately, the stream might be still being processed in
snd_pcm_period_elapsed() in the interrupt context, and hits a NULL
dereference. Such a crash happens because of the atomic operation,
and we can't wait until the stream-stop finishes.
For addressing such a problem, this commit adds a new PCM ops,
sync_stop. This gets called at the appropriate places that need a
sync with the stream-stop, i.e. at hw_params, prepare and hw_free.
Some drivers already have a similar mechanism implemented locally, and
we'll refactor the code later.
Link: https://lore.kernel.org/r/20191117085308.23915-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/format.h')
0 files changed, 0 insertions, 0 deletions