diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-09-25 11:51:11 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-09-25 11:52:07 -0400 |
commit | 24e8fc498e9618338854bfbcf8d1d737e0bf1775 (patch) | |
tree | c87b8c9de12e8007620396f179d1f1c739aaaaab /sound | |
parent | 399ccdc1cd4e92e541d4dacbbf18c52bd693418b (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_native.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index c49b9d9e303..c487025d345 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -1546,16 +1546,10 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream) | |||
1546 | card = substream->pcm->card; | 1546 | card = substream->pcm->card; |
1547 | 1547 | ||
1548 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN || | 1548 | if (runtime->status->state == SNDRV_PCM_STATE_OPEN || |
1549 | runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED) | 1549 | runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED || |
1550 | runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) | ||
1550 | return -EBADFD; | 1551 | return -EBADFD; |
1551 | 1552 | ||
1552 | snd_power_lock(card); | ||
1553 | if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) { | ||
1554 | result = snd_power_wait(card, SNDRV_CTL_POWER_D0); | ||
1555 | if (result < 0) | ||
1556 | goto _unlock; | ||
1557 | } | ||
1558 | |||
1559 | snd_pcm_stream_lock_irq(substream); | 1553 | snd_pcm_stream_lock_irq(substream); |
1560 | /* resume pause */ | 1554 | /* resume pause */ |
1561 | if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) | 1555 | if (runtime->status->state == SNDRV_PCM_STATE_PAUSED) |
@@ -1564,8 +1558,7 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream) | |||
1564 | snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); | 1558 | snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); |
1565 | /* runtime->control->appl_ptr = runtime->status->hw_ptr; */ | 1559 | /* runtime->control->appl_ptr = runtime->status->hw_ptr; */ |
1566 | snd_pcm_stream_unlock_irq(substream); | 1560 | snd_pcm_stream_unlock_irq(substream); |
1567 | _unlock: | 1561 | |
1568 | snd_power_unlock(card); | ||
1569 | return result; | 1562 | return result; |
1570 | } | 1563 | } |
1571 | 1564 | ||