From fea50d9677667c1d886c255c29ebeb433184e003 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 19 Sep 2013 15:58:45 -0700 Subject: [PATCH] ASoC: msm: handle write done events in pause state If a write done event is received when the compress driver is in paused state, treat it as an underrun. Change-Id: I56ca867983b9139c04d135276da7344ac912065e Signed-off-by: Haynes Mathew George Signed-off-by: Eric Laurent Git-commit: 6b9c3272087127fda41ed65ee7f8536ad9748383 Git-repo: https://android.googlesource.com/kernel/msm Signed-off-by: Dhananjay Kumar --- sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c index b34843cbf7e8..324fcf2fa861 100644 --- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c @@ -205,6 +205,9 @@ static void compr_event_handler(uint32_t opcode, snd_compr_fragment_elapsed(cstream); if (!atomic_read(&prtd->start)) { + /* Writes must be restarted from _copy() */ + pr_debug("write_done received while not started, treat as xrun"); + atomic_set(&prtd->xrun, 1); spin_unlock_irq(&prtd->lock); break; }