mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 03:43:03 +00:00
ASoC: msm: fix indefinite wait in compress drain
In compressed driver streams might get stopped while ioctl drain is started but not completed, since buffers are drained in multiple stages when gapless mode is enabled. Check stream state before issuing wait commands to prevent waiting for drain ack on stopped streams. Change-Id: I606639c103a7aed90dd9a4561fa6dffc3d4c3822 Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
This commit is contained in:
parent
7114c2c052
commit
04eb413627
|
@ -1620,7 +1620,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
|
|||
if (prtd->last_buffer) {
|
||||
pr_debug("%s: last buffer drain\n", __func__);
|
||||
rc = msm_compr_drain_buffer(prtd, &flags);
|
||||
if (rc) {
|
||||
if (rc || !atomic_read(&prtd->start)) {
|
||||
spin_unlock_irqrestore(&prtd->lock,
|
||||
flags);
|
||||
break;
|
||||
|
@ -1639,7 +1639,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
|
|||
/* wait for the zero length buffer to be returned */
|
||||
pr_debug("%s: zero length buffer drain\n", __func__);
|
||||
rc = msm_compr_drain_buffer(prtd, &flags);
|
||||
if (rc) {
|
||||
if (rc || !atomic_read(&prtd->start)) {
|
||||
spin_unlock_irqrestore(&prtd->lock, flags);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue