ALSA: compress: Add function to indicate the stream has gone bad
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Mon, 13 Jun 2016 13:17:10 +0000 (14:17 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 13 Jun 2016 15:45:37 +0000 (16:45 +0100)
commita4f2d87c63571d4cd9467d369f2fbf2362646043
tree9ba1c814757a52c9f18c2be6bf0fd85f3c0d0e2a
parent1a695a905c18548062509178b98bc91e67510864
ALSA: compress: Add function to indicate the stream has gone bad

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>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/compress_driver.h
sound/core/compress_offload.c