linux/sound/core
Takashi Iwai 257f8cce5d ALSA: pcm: Allow nonatomic trigger operations
Currently, many PCM operations are performed in a critical section
protected by spinlock, typically the trigger and pointer callbacks are
assumed to be atomic.  This is basically because some trigger action
(e.g. PCM stop after drain or xrun) is done in the interrupt handler.
If a driver runs in a threaded irq, however, this doesn't have to be
atomic.  And many devices want to handle trigger in a non-atomic
context due to lengthy communications.

This patch tries all PCM calls operational in non-atomic context.
What it does is very simple: replaces the substream spinlock with the
corresponding substream mutex when pcm->nonatomic flag is set.  The
driver that wants to use the non-atomic PCM ops just needs to set the
flag and keep the rest as is.  (Of course, it must not handle any PCM
ops in irq context.)

Note that the code doesn't check whether it's atomic-safe or not, but
trust in 100% that the driver sets pcm->nonatomic correctly.

One possible problem is the case where linked PCM substreams have
inconsistent nonatomic states.  For avoiding this, snd_pcm_link()
returns an error if one tries to link an inconsistent PCM substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-03 14:04:08 +02:00
..
oss ALSA: oss: Use standard printk helpers 2014-02-14 08:14:17 +01:00
seq ALSA: seq: seq_memory.c: Fix closing brace followed by if 2014-06-23 17:58:33 +02:00
compress_offload.c ALSA: compress: fix an integer overflow check 2014-07-16 15:27:03 +02:00
control.c ALSA: control: Define SNDRV_CTL_TLV_OP_* constants 2014-07-15 16:31:01 +02:00
control_compat.c ALSA: control: Use standard printk helpers 2014-02-14 08:14:14 +01:00
ctljack.c ALSA: hda - Add missing inclusion of linux/export.h 2011-11-16 14:28:33 +01:00
device.c ALSA: Clean up snd_device_*() codes 2014-02-25 12:12:52 +01:00
hrtimer.c ALSA: timer: Use standard printk helpers 2014-02-14 08:14:17 +01:00
hwdep.c ALSA: Move EXPORT_SYMBOL() in appropriate places 2014-02-27 16:00:51 +01:00
hwdep_compat.c [PATCH] hwdep_compat missed __user annotations 2006-10-10 15:37:21 -07:00
info.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00
info_oss.c ALSA: remove the main version information 2012-09-04 11:38:32 +02:00
init.c ALSA: control: Protect user controls against concurrent access 2014-06-18 15:12:33 +02:00
isadma.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00
jack.c ALSA: jack: Unregister input device at disconnection 2013-11-14 17:22:45 +01:00
Kconfig ALSA: core: allow SND_DMAENGINE_PCM use from modules 2013-08-15 18:28:42 +01:00
Makefile ALSA: Merge memalloc code into snd-pcm module 2014-01-09 08:12:57 +01:00
memalloc.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00
memory.c ALSA: add/change some comments describing function return values 2013-03-12 08:32:53 +01:00
misc.c sound: use printk_get_level and printk_skip_level 2012-07-30 17:25:14 -07:00
pcm.c ALSA: pcm: Allow nonatomic trigger operations 2014-09-03 14:04:08 +02:00
pcm_compat.c ALSA: pcm: Add tstamp_type and proto to sw_params compat layer 2014-07-21 09:08:18 +02:00
pcm_dmaengine.c ALSA: pcm_dmaengine: Correct support for 24bits physical sample widths 2014-07-04 18:55:25 +01:00
pcm_lib.c ALSA: pcm: 'BUG:' message unnecessarily triggers kerneloops 2014-04-16 16:20:59 +02:00
pcm_memory.c ALSA: PCM: Warn when buffer preallocation fails 2014-01-11 11:04:23 +01:00
pcm_misc.c ALSA: Add helper function for intersecting two rate masks 2014-01-14 20:42:34 +00:00
pcm_native.c ALSA: pcm: Allow nonatomic trigger operations 2014-09-03 14:04:08 +02:00
pcm_timer.c ALSA: pcm: Use standard printk helpers 2014-02-14 08:14:15 +01:00
rawmidi.c ALSA: Move EXPORT_SYMBOL() in appropriate places 2014-02-27 16:00:51 +01:00
rawmidi_compat.c [ALSA] Remove xxx_t typedefs: Raw MIDI 2006-01-03 12:17:35 +01:00
rtctimer.c ALSA: timer: Use standard printk helpers 2014-02-14 08:14:17 +01:00
sgbuf.c ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases 2012-09-23 11:24:42 +02:00
sound.c ALSA: Create sysfs attribute files via groups 2014-02-25 12:12:49 +01:00
sound_oss.c ALSA: Use standard device refcount for card accounting 2014-02-14 08:14:13 +01:00
timer.c ALSA: core: Use ktime_get_ts() 2014-06-12 12:58:16 +02:00
timer_compat.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
vmaster.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00