1
0
Fork 0
alistair23-linux/sound
Takashi Iwai 1e850beea2 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>
2019-11-20 19:39:54 +01:00
..
ac97 ALSA: ac97: Fix double free of ac97_codec_device 2019-07-23 14:16:11 +02:00
aoa ALSA: aoa: Avoid non-standard macro usage 2019-11-06 15:47:43 +01:00
arm ASoC: pxa: remove snd_pcm_ops 2019-10-08 13:47:20 +01:00
atmel treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
core ALSA: pcm: Add the support for sync-stop operation 2019-11-20 19:39:54 +01:00
drivers ALSA: aloop: Support runtime change of snd_timer via info interface 2019-11-20 19:38:30 +01:00
firewire Merge branch 'for-linus' into for-next 2019-11-07 16:27:55 +01:00
hda ALSA: hda: Disable regmap internal locking 2019-11-05 12:54:53 +01:00
i2c ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls() 2019-07-26 14:25:37 +02:00
isa sound: Fix Kconfig indentation 2019-10-07 03:53:03 +02:00
mips ALSA: mips: Convert to the common vmalloc memalloc 2019-11-06 15:47:43 +01:00
oss sound: dmasound_atari: Mark expected switch fall-through 2019-07-30 09:36:13 +02:00
parisc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176 2019-05-30 11:29:19 -07:00
pci ALSA: hda - Add mute led support for HP ProBook 645 G4 2019-11-20 09:42:52 +01:00
pcmcia ALSA: pdaudiocf: Convert to the common vmalloc memalloc 2019-11-06 15:47:42 +01:00
ppc ALSA: ps3: Remove Unneeded variable: "ret" 2019-07-10 11:53:31 +02:00
sh ALSA: sh: Remove superfluous snd_dma_continuous_data() 2019-11-06 15:47:41 +01:00
soc ASoC: cros_ec_codec: Convert to the common vmalloc memalloc 2019-11-09 18:02:53 +01:00
sparc ALSA: sparc: Remove superfluous snd_dma_continuous_data() 2019-11-06 15:47:41 +01:00
spi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
synth treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
usb ALSA: usb-audio: Add skip_validation option 2019-11-14 18:02:38 +01:00
x86 ALSA: intel_hdmi: Remove dev_err() on platform_get_irq() failure 2019-10-25 14:43:23 +02:00
xen ASoC: Updates for v5.3 2019-07-08 14:45:34 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
ac97_bus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
last.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
sound_core.c sound: fix a memory leak bug 2019-08-08 08:18:32 +02:00