From 23c544c4c940b460462b0c8a919bfd75658a7f1c Mon Sep 17 00:00:00 2001 From: Satya Krishna Pindiproli Date: Tue, 9 Aug 2016 17:02:20 +0530 Subject: [PATCH] ASoC: msm: qdsp6v2: fix crash during flac superset clip playback During playback of a particular superset flac clip in repeat mode, the target crashes when random seek operations are done after a gapless switch. This is because DSP acks EOS earlier than expected due to which gapless_transition flag is always set during playback of the second stream. As a result, flush commands are not issued to DSP causing the decoder to go into a bad state that leads to a crash. Set gapless_transition flag only if EOS has not been acknowledged yet. CRs-Fixed: 1045100 Change-Id: I71af0e13b77ecf53a1b337e3fb2f7a82a2ce25af Signed-off-by: Satya Krishna Pindiproli --- sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c index 08c2b89de646..ebb6ee48a1ef 100755 --- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c @@ -1740,7 +1740,12 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd) prtd->app_pointer = 0; prtd->first_buffer = 1; prtd->last_buffer = 0; - prtd->gapless_state.gapless_transition = 1; + /* + * Set gapless transition flag only if EOS hasn't been + * acknowledged already. + */ + if (atomic_read(&prtd->eos)) + prtd->gapless_state.gapless_transition = 1; prtd->marker_timestamp = 0; /*