linux-stable/sound
Takashi Iwai 230323dac0 ALSA: timer: Handle disconnection more safely
Currently ALSA timer device doesn't take the disconnection into
account very well; it merely unlinks the timer device at disconnection
callback but does nothing else.  Because of this, when an application
accessing the timer device is disconnected, it may release the
resource before actually closed.  In most cases, it results in a
warning message indicating a leftover timer instance like:
   ALSA: timer xxxx is busy?
But basically this is an open race.

This patch tries to address it.  The strategy is like other ALSA
devices: namely,
- Manage card's refcount at each open/close
- Wake up the pending tasks at disconnection
- Check the shutdown flag appropriately at each possible call

Note that this patch has one ugly hack to handle the wakeup of pending
tasks.  It'd be cleaner to introduce a new disconnect op to
snd_timer_instance ops.  But since it would lead to internal ABI
breakage and it eventually increase my own work when backporting to
stable kernels, I took a different path to implement locally in
timer.c.  A cleanup patch will follow at next for 4.5 kernel.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109431
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-21 17:41:50 +01:00
..
aoa ALSA: aoa-soundbus: Switch to dev_pm_ops 2015-08-05 16:47:47 +02:00
arm ASoC: pxa: pxa-pcm-lib: switch over to snd-soc-dmaengine-pcm 2015-09-30 23:21:16 +01:00
atmel ALSA: sound/atmel/ac97c.c: remove unused variable 2015-05-20 06:18:25 +02:00
core ALSA: timer: Handle disconnection more safely 2016-01-21 17:41:50 +01:00
drivers ALSA: dummy: constify dummy_timer_ops structures 2015-12-30 22:49:42 +01:00
firewire ALSA: dice: expand timeout to wait for Dice notification 2016-01-06 10:18:54 +01:00
hda ALSA: hda - Degrade i915 binding failure message 2016-01-20 15:00:26 +01:00
i2c ALSA: i2c: constify snd_i2c_ops structures 2015-11-30 11:40:08 +01:00
isa ALSA: gus: use swap() in snd_ics_put_double() 2015-06-12 20:46:29 +02:00
mips ALSA: mips: let SND_SGI_O2 select SND_PCM 2015-06-15 13:21:58 +02:00
oss sound/oss: remove VIRT_TO_BUS dependency 2015-12-09 14:40:51 +01:00
parisc
pci ALSA: hda - Flush the pending probe work at remove 2016-01-20 17:19:02 +01:00
pcmcia
ppc ALSA: ppc: Add missing inclusion of linux/module.h 2015-08-25 14:13:36 +02:00
sh
soc ASoC: Last updates for v4.5 2016-01-11 17:50:15 +01:00
sparc ALSA: sparc: amd7930: Fix module autoload for OF platform driver 2015-09-04 12:11:44 +02:00
spi ALSA: at73c213: manage SSC clock 2016-01-20 09:59:27 +01:00
synth ALSA: emux: constify nrpn_conv_table structures 2016-01-06 10:19:49 +01:00
usb ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices 2016-01-13 07:24:07 +01:00
ac97_bus.c ASoC: Updates for v4.3 2015-08-31 16:25:22 +02:00
Kconfig
last.c
Makefile
sound_core.c sound: fix check for error condition of register_chrdev() 2015-11-07 11:14:30 +01:00
sound_firmware.c sound: sound_firmware: Fix invalid use of vfs_read() 2015-05-26 13:48:58 +02:00