From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: vinod.koul@intel.com, tiwai@suse.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
lgirdwood@gmail.com
Subject: Re: [PATCH v6 2/4] ALSA: compress: Add function to indicate the stream has gone bad
Date: Tue, 3 May 2016 17:57:54 +0100 [thread overview]
Message-ID: <20160503165754.GC1646@localhost.localdomain> (raw)
In-Reply-To: <1461338126-25998-3-git-send-email-ckeepax@opensource.wolfsonmicro.com>
On Fri, Apr 22, 2016 at 04:15:24PM +0100, Charles Keepax wrote:
> Currently, the avail IOCTL doesn't pass any error status, which
> means typically on error it simply shows no data available. This
> can lead to situations where user-space is waiting indefinitely
> for data that will never come as the DSP has suffered an
> unrecoverable error.
>
> Add snd_compr_stop_error which end drivers can call to indicate
> the stream has suffered an unrecoverable error and stop it. The
> avail and poll IOCTLs are then updated to report if the stream is
> in an error state to user-space. Allowing the error to propagate
> out. Processing of the actual snd_compr_stop needs to be deferred
> to a worker thread as the end driver may detect the errors during
> an existing operation callback.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> Acked-by: Vinod Koul <vinod.koul@intel.com>
> ---
> @@ -400,10 +418,18 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
> return -EFAULT;
>
> mutex_lock(&stream->device->lock);
> - if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
> +
> + switch (stream->runtime->state) {
> + case SNDRV_PCM_STATE_OPEN:
> retval = -EBADFD;
> goto out;
> + case SNDRV_PCM_STATE_XRUN:
> + retval = -EPIPE;
> + goto out;
> + default:
> + break;
> }
One more issue to fix up before we can submit these I am afraid.
We can't return negative values from snd_compr_poll, I need to
fix both the original -EBADFD and the -EPIPE that my patch adds
here.
I will do a new rev of the patches shortly, sorry about missing
this until now.
Thanks,
Charles
next prev parent reply other threads:[~2016-05-03 16:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 15:15 [PATCH v6 0/4] Propagate errors out from compressed streams Charles Keepax
2016-04-22 15:15 ` [PATCH v6 1/4] ALSA: compress: Replace complex if statement with switch Charles Keepax
2016-05-04 15:01 ` Charles Keepax
2016-04-22 15:15 ` [PATCH v6 2/4] ALSA: compress: Add function to indicate the stream has gone bad Charles Keepax
2016-05-03 16:57 ` Charles Keepax [this message]
2016-04-22 15:15 ` [PATCH v6 3/4] ASoC: wm_adsp: Use new snd_compr_stop_error to signal stream failure Charles Keepax
2016-04-22 15:15 ` [PATCH v6 4/4] ASoC: compress: Pass error out of soc_compr_pointer Charles Keepax
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=20160503165754.GC1646@localhost.localdomain \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).