[svn-commits] sruffell: linux/trunk r8467 - /linux/trunk/drivers/dahdi/voicebus/voicebus.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Apr 4 11:14:57 CDT 2010


Author: sruffell
Date: Sun Apr  4 11:14:56 2010
New Revision: 8467

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8467
Log:
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.

Modified:
    linux/trunk/drivers/dahdi/voicebus/voicebus.c

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=8467&r1=8466&r2=8467
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.c Sun Apr  4 11:14:56 2010
@@ -1300,32 +1300,17 @@
 	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))
+		if (1 == atomic_read(&dl->count))
+			return;
+
+		behind = 2;
+		while (!OWNED(d)) {
+			if (d->buffer1 != vb->idle_vbb_dma_addr)
 				goto tx_error_exit;
-
-			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 {




More information about the svn-commits mailing list