ALSA: pcm: Allow dropping stream directly after resume
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 May 2016 13:08:31 +0000 (15:08 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 14 Jun 2017 05:43:52 +0000 (07:43 +0200)
So far, the PCM core refuses DROP ioctl when the stream in the
suspended state.  This was basically to avoid the invalid state change
*during* the suspend.  But since we protect the power change globally
in the common PCM ioctl caller side, it's guaranteed that
snd_pcm_drop() is called at the right power state.  So we can assume
that the drop of stream is safe immediately after SUSPENDED state.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c

index bd1b74aa20682df02b91a8dd8363c34a3f75b253..69cf9b02ac70763a746e3bedb2fe8219f4e45222 100644 (file)
@@ -1883,8 +1883,7 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
        runtime = substream->runtime;
 
        if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
-           runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
-           runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
+           runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED)
                return -EBADFD;
 
        snd_pcm_stream_lock_irq(substream);