ALSA: remove unneeded power_mutex lock in snd_pcm_drop
The power_mutex lock in snd_pcm_drop may cause a possible deadlock chain, and above all, it's unneeded. Let's get rid of it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -1546,16 +1546,10 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
|
|||||||
card = substream->pcm->card;
|
card = substream->pcm->card;
|
||||||
|
|
||||||
if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
|
if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
|
||||||
runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
|
runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
|
||||||
|
runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
|
||||||
return -EBADFD;
|
return -EBADFD;
|
||||||
|
|
||||||
snd_power_lock(card);
|
|
||||||
if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
|
|
||||||
result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
|
|
||||||
if (result < 0)
|
|
||||||
goto _unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
snd_pcm_stream_lock_irq(substream);
|
snd_pcm_stream_lock_irq(substream);
|
||||||
/* resume pause */
|
/* resume pause */
|
||||||
if (runtime->status->state == SNDRV_PCM_STATE_PAUSED)
|
if (runtime->status->state == SNDRV_PCM_STATE_PAUSED)
|
||||||
@@ -1564,8 +1558,7 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
|
|||||||
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
|
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
|
||||||
/* runtime->control->appl_ptr = runtime->status->hw_ptr; */
|
/* runtime->control->appl_ptr = runtime->status->hw_ptr; */
|
||||||
snd_pcm_stream_unlock_irq(substream);
|
snd_pcm_stream_unlock_irq(substream);
|
||||||
_unlock:
|
|
||||||
snd_power_unlock(card);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user