From 719e91e72ddf05e614ee569c43f2b22898f7d2bc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 7 Oct 2014 18:38:53 +0530 Subject: [PATCH] ALSA: Avoid endless sleep after disconnect 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. Selectively taken from 0914f7961babbf28aaa2f19b453951fb4841c03f from kernel/msm-3.10 Change-Id: Id5f19eef3b3db030854b7d40a188d5b23ed8da45 Signed-off-by: Takashi Iwai Signed-off-by: Divya Narayanan Poojary --- sound/core/pcm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index f174685a7f3..58d377c2785 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -1216,8 +1216,11 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) list_del_init(&pcm->list); for (cidx = 0; cidx < 2; cidx++) for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) - if (substream->runtime) + if (substream->runtime) { substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; + wake_up(&substream->runtime->sleep); + wake_up(&substream->runtime->tsleep); + } list_for_each_entry(notify, &snd_pcm_notify_list, list) { notify->n_disconnect(pcm); }