From f0445a9b9990aa3eb55d67ff62933082b603e00d Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sun, 4 Apr 2010 16:14:56 +0000 Subject: 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 --- drivers/dahdi/voicebus/voicebus.c | 33 +++++++++------------------------ 1 file 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 { -- cgit v1.2.3