]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.14/asoc-wm_adsp-correct-handling-of-compressed-streams-that-restart.patch
Linux 4.19.41
[thirdparty/kernel/stable-queue.git] / releases / 5.0.14 / asoc-wm_adsp-correct-handling-of-compressed-streams-that-restart.patch
1 From 639e5eb3c7d67e407f2a71fccd95323751398f6f Mon Sep 17 00:00:00 2001
2 From: Charles Keepax <ckeepax@opensource.cirrus.com>
3 Date: Tue, 19 Mar 2019 11:52:04 +0000
4 Subject: ASoC: wm_adsp: Correct handling of compressed streams that restart
5
6 From: Charles Keepax <ckeepax@opensource.cirrus.com>
7
8 commit 639e5eb3c7d67e407f2a71fccd95323751398f6f upstream.
9
10 Previously support was added to allow streams to be stopped and
11 started again without the DSP being power cycled and this was done
12 by clearing the buffer state in trigger start. Another supported
13 use-case is using the DSP for a trigger event then opening the
14 compressed stream later to receive the audio, unfortunately clearing
15 the buffer state in trigger start destroys the data received
16 from such a trigger. Correct this issue by moving the call to
17 wm_adsp_buffer_clear to be in trigger stop instead.
18
19 Fixes: 61fc060c40e6 ("ASoC: wm_adsp: Support streams which can start/stop with DSP active")
20 Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
21 Signed-off-by: Mark Brown <broonie@kernel.org>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 sound/soc/codecs/wm_adsp.c | 3 +--
26 1 file changed, 1 insertion(+), 2 deletions(-)
27
28 --- a/sound/soc/codecs/wm_adsp.c
29 +++ b/sound/soc/codecs/wm_adsp.c
30 @@ -3443,8 +3443,6 @@ int wm_adsp_compr_trigger(struct snd_com
31 }
32 }
33
34 - wm_adsp_buffer_clear(compr->buf);
35 -
36 /* Trigger the IRQ at one fragment of data */
37 ret = wm_adsp_buffer_write(compr->buf,
38 HOST_BUFFER_FIELD(high_water_mark),
39 @@ -3456,6 +3454,7 @@ int wm_adsp_compr_trigger(struct snd_com
40 }
41 break;
42 case SNDRV_PCM_TRIGGER_STOP:
43 + wm_adsp_buffer_clear(compr->buf);
44 break;
45 default:
46 ret = -EINVAL;