Commit 48079bc7 authored by Alessandro Rubini's avatar Alessandro Rubini

tasklet: proceed with data_done even if no block is there

Now that we are self-timed, the only reason white the active input
block is null may be a zio buffer-full situation.  We need to keep
the loop running anyways (by discarding one sample), because we miss
notification when the buffer has new space.

We can't change zio to this aim, as it would be extra code in a hot
path: we'd better loose one block when the buffer is full, we would
loose it soon after anyways, since the system is overloaded.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 14b5d0da
......@@ -88,10 +88,14 @@ int fd_read_sw_fifo(struct fd_dev *fd, struct zio_channel *chan)
struct fd_time t;
unsigned long flags;
if (!chan->active_block)
return -EAGAIN;
if (fd->sw_fifo.tail == fd->sw_fifo.head)
return -EAGAIN;
/*
* Proceed even if no active block is there. The buffer may be
* full, but we need to keep the trigger armed for next time,
* so deal with data and return success. If we -EAGAIN when
* !chan->active_block is null, we'll miss an irq to restar the loop.
*/
/* Copy the sample to local storage */
spin_lock_irqsave(&fd->lock, flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment