All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org, tiwai@suse.com
Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org,
	patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com
Subject: [PATCH 4/4] ASoC: wm_adsp: Improve DSP error handling
Date: Thu, 10 Mar 2016 10:44:54 +0000	[thread overview]
Message-ID: <1457606694-10985-4-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1457606694-10985-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

If we encounter an error on the DSP side whilst user-space is waiting on
the poll we should call snd_compr_fragment_elapsed, although data is
not actually available we want to wake user-space such that the error
can be propagated out quickly. Additionally some versions of the DSP
firmware are not super consistent about actually generating an IRQ if
they encounter an error, as such we will check the DSP error status
every time we run out of available data as well, to ensure we catch it.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index f28c244..3ee1c72 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2861,10 +2861,10 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp)
 		goto out;
 	}
 
+out:
 	if (compr && compr->stream)
 		snd_compr_fragment_elapsed(compr->stream);
 
-out:
 	mutex_unlock(&dsp->pwr_lock);
 
 	return ret;
@@ -2926,6 +2926,10 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
 					 ret);
 				goto out;
 			}
+
+			ret = wm_adsp_buffer_check_error(buf);
+			if (ret < 0)
+				goto out;
 		}
 	}
 
-- 
2.1.4

  parent reply	other threads:[~2016-03-10 10:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 10:44 [PATCH 1/4] ASoC: compress: Pass error out of soc_compr_pointer Charles Keepax
2016-03-10 10:44 ` [PATCH 2/4] ALSA: compress: Handle errors during avail requests Charles Keepax
2016-03-11  7:54   ` Vinod Koul
2016-03-10 10:44 ` [PATCH 3/4] ASoC: wm_adsp: Factor out checking of stream errors from the DSP Charles Keepax
2016-03-10 10:44 ` Charles Keepax [this message]
2016-03-10 16:41   ` [PATCH 4/4] ASoC: wm_adsp: Improve DSP error handling Charles Keepax
2016-03-11  7:48 ` [PATCH 1/4] ASoC: compress: Pass error out of soc_compr_pointer Vinod Koul
2016-03-11 10:04   ` Charles Keepax
2016-03-11 10:25     ` Takashi Iwai
2016-03-11 10:41       ` Vinod Koul
2016-03-11 10:37     ` Vinod Koul
2016-03-11 10:39       ` Takashi Iwai
2016-03-11 11:13         ` Charles Keepax
2016-03-11 11:14         ` Vinod Koul
2016-03-21 13:07           ` Charles Keepax
2016-06-22 15:29 ` Applied "ASoC: compress: Pass error out of soc_compr_pointer" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457606694-10985-4-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.