summaryrefslogtreecommitdiff
path: root/sound/core/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-07 12:42:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-17 13:16:13 -0800
commit9de4f2694044af68a826a568f0c97b1b83b5b173 (patch)
tree3b6d62d4b5f8365cbcd1dba79e13be1af6839138 /sound/core/pcm.c
parent41a496238dae4c117548be819b0a3b3edbc48dc8 (diff)
downloadlwn-9de4f2694044af68a826a568f0c97b1b83b5b173.tar.gz
lwn-9de4f2694044af68a826a568f0c97b1b83b5b173.zip
ALSA: Avoid endless sleep after disconnect
commit 0914f7961babbf28aaa2f19b453951fb4841c03f upstream. When disconnect callback is called, each component should wake up sleepers and check card->shutdown flag for avoiding the endless sleep blocking the proper resource release. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r--sound/core/pcm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 099f3fdd120a..e30e1be30a21 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -1087,12 +1087,16 @@ static int snd_pcm_dev_disconnect(struct snd_device *device)
goto unlock;
mutex_lock(&pcm->open_mutex);
+ wake_up(&pcm->open_wait);
list_del_init(&pcm->list);
for (cidx = 0; cidx < 2; cidx++)
for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) {
snd_pcm_stream_lock_irq(substream);
- if (substream->runtime)
+ if (substream->runtime) {
substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
+ wake_up(&substream->runtime->sleep);
+ wake_up(&substream->runtime->tsleep);
+ }
snd_pcm_stream_unlock_irq(substream);
}
list_for_each_entry(notify, &snd_pcm_notify_list, list) {