diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-07 12:44:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-17 13:14:22 -0800 |
commit | 8a7173c58c8a1e25d7b2d572f045da837bb373bf (patch) | |
tree | 1b16fcddcaffe247fc152ec187c7e439c8c43d6c /sound/core/pcm.c | |
parent | 40edba667959559aa4385a5ec047420fcfeb5f03 (diff) | |
download | kernel_samsung_smdk4412-8a7173c58c8a1e25d7b2d572f045da837bb373bf.zip kernel_samsung_smdk4412-8a7173c58c8a1e25d7b2d572f045da837bb373bf.tar.gz kernel_samsung_smdk4412-8a7173c58c8a1e25d7b2d572f045da837bb373bf.tar.bz2 |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 1d25612..6e86ed5 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -1046,12 +1046,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) { |