diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-04-04 16:14:56 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-04-04 16:14:56 +0000 |
commit | f0445a9b9990aa3eb55d67ff62933082b603e00d (patch) | |
tree | 4a8b69ba169fc4a38e6d06d6cdf209d7e774268f | |
parent | b964d7907c776d74c638ad3862461094189d7db7 (diff) |
wcte12xp, wctdm24xxp: If we're only one packet behind, just exit.
This will make us two behind, which is fine, and eliminates a busy loop in
atomic context.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8467 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/voicebus/voicebus.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c index ca72f0a..9ae2155 100644 --- a/drivers/dahdi/voicebus/voicebus.c +++ b/drivers/dahdi/voicebus/voicebus.c @@ -1300,32 +1300,17 @@ static void vb_tasklet_normal(unsigned long data) if (unlikely(atomic_read(&dl->count) < 2)) { softunderrun = 1; d = vb_descriptor(dl, dl->head); - if (1 == atomic_read(&dl->count)) { - unsigned long stop; - stop = jiffies + HZ/4; - while (OWNED(d) && time_after(stop, jiffies)) - continue; - if (time_before(stop, jiffies)) - goto tx_error_exit; + if (1 == atomic_read(&dl->count)) + return; - if (d->buffer1 == vb->idle_vbb_dma_addr) + behind = 2; + while (!OWNED(d)) { + if (d->buffer1 != vb->idle_vbb_dma_addr) goto tx_error_exit; - - vbb = vb_get_completed_txb(vb); - WARN_ON(!vbb); - if (vbb) - list_add_tail(&vbb->entry, &vb->tx_complete); - behind = 1; - } else { - behind = 2; - while (!OWNED(d)) { - if (d->buffer1 != vb->idle_vbb_dma_addr) - goto tx_error_exit; - SET_OWNED(d); - dl->head = ++dl->head & DRING_MASK; - d = vb_descriptor(dl, dl->head); - ++behind; - } + SET_OWNED(d); + dl->head = ++dl->head & DRING_MASK; + d = vb_descriptor(dl, dl->head); + ++behind; } } else { |