summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-07-22 10:24:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-16 10:11:04 +0200
commit7989879611415f429bbb2b144bfe33a8daad0e64 (patch)
treefbfe7abdec3a731dcf402bfcb74dd96ab1f1c0f9 /include
parent860798838b6562f899bed2b862bdf68e045ed961 (diff)
downloadlinux-stable-7989879611415f429bbb2b144bfe33a8daad0e64.tar.gz
linux-stable-7989879611415f429bbb2b144bfe33a8daad0e64.tar.bz2
linux-stable-7989879611415f429bbb2b144bfe33a8daad0e64.zip
ALSA: compress: Fix regression on compressed capture streams
[ Upstream commit 4475f8c4ab7b248991a60d9c02808dbb813d6be8 ] A previous fix to the stop handling on compressed capture streams causes some knock on issues. The previous fix updated snd_compr_drain_notify to set the state back to PREPARED for capture streams. This causes some issues however as the handling for snd_compr_poll differs between the two states and some user-space applications were relying on the poll failing after the stream had been stopped. To correct this regression whilst still fixing the original problem the patch was addressing, update the capture handling to skip the PREPARED state rather than skipping the SETUP state as it has done until now. Fixes: 4f2ab5e1d13d ("ALSA: compress: Fix stop handling on compressed capture streams") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/compress_driver.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
index c5188ff724d1..bc88d6f964da 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
@@ -173,10 +173,7 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
if (snd_BUG_ON(!stream))
return;
- if (stream->direction == SND_COMPRESS_PLAYBACK)
- stream->runtime->state = SNDRV_PCM_STATE_SETUP;
- else
- stream->runtime->state = SNDRV_PCM_STATE_PREPARED;
+ stream->runtime->state = SNDRV_PCM_STATE_SETUP;
wake_up(&stream->runtime->sleep);
}