aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-06-13 09:17:11 -0400
committerMark Brown <broonie@kernel.org>2016-06-13 11:49:51 -0400
commit8d280664d26538cd37e7c08b1c2b58fe006cc482 (patch)
tree6c37e4bfe082f53b91e2fc77ad8e681efa8f0953
parent7a75c0d110c77a73d9d154aaddc9cda7744757cf (diff)
ASoC: wm_adsp: Use new snd_compr_stop_error to signal stream failure
If we encounter a fatal error on the compressed stream call the new snd_compr_stop_error to shutdown the stream and allow the core to inform user-space that the stream is no longer valid. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm_adsp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index a07bd7c2c587..8ed1cdececf2 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3043,6 +3043,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
3043 } 3043 }
3044 3044
3045 if (compr->buf->error) { 3045 if (compr->buf->error) {
3046 snd_compr_stop_error(stream, SNDRV_PCM_STATE_XRUN);
3046 ret = -EIO; 3047 ret = -EIO;
3047 goto out; 3048 goto out;
3048 } 3049 }
@@ -3060,8 +3061,12 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
3060 */ 3061 */
3061 if (buf->avail < wm_adsp_compr_frag_words(compr)) { 3062 if (buf->avail < wm_adsp_compr_frag_words(compr)) {
3062 ret = wm_adsp_buffer_get_error(buf); 3063 ret = wm_adsp_buffer_get_error(buf);
3063 if (ret < 0) 3064 if (ret < 0) {
3065 if (compr->buf->error)
3066 snd_compr_stop_error(stream,
3067 SNDRV_PCM_STATE_XRUN);
3064 goto out; 3068 goto out;
3069 }
3065 3070
3066 ret = wm_adsp_buffer_reenable_irq(buf); 3071 ret = wm_adsp_buffer_reenable_irq(buf);
3067 if (ret < 0) { 3072 if (ret < 0) {
@@ -3159,8 +3164,10 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr,
3159 if (!compr->buf) 3164 if (!compr->buf)
3160 return -ENXIO; 3165 return -ENXIO;
3161 3166
3162 if (compr->buf->error) 3167 if (compr->buf->error) {
3168 snd_compr_stop_error(compr->stream, SNDRV_PCM_STATE_XRUN);
3163 return -EIO; 3169 return -EIO;
3170 }
3164 3171
3165 count /= WM_ADSP_DATA_WORD_SIZE; 3172 count /= WM_ADSP_DATA_WORD_SIZE;
3166 3173