[svn-commits] sruffell: linux/trunk r9888 - /linux/trunk/drivers/dahdi/voicebus/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 4 11:25:53 CDT 2011


Author: sruffell
Date: Mon Apr  4 11:25:47 2011
New Revision: 9888

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9888
Log:
wcte12xp, wctdm24xxp: decriptor_list.count does not need to be atomic.

It is only ever accessed in interrupt context anyway. Saves several
hundred nanoseconds from hard interrupt context.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Michael Spiceland <mspiceland at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>

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

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=9888&r1=9887&r2=9888
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.c Mon Apr  4 11:25:47 2011
@@ -271,7 +271,7 @@
 		d->des1 = cpu_to_le32(des1);
 	}
 	d->des1 |= cpu_to_le32(END_OF_RING);
-	atomic_set(&dl->count, 0);
+	dl->count = 0;
 	return 0;
 }
 
@@ -326,7 +326,7 @@
 		d->buffer1 = 0;
 	}
 	d->des1 |= cpu_to_le32(END_OF_RING);
-	atomic_set(&dl->count, 0);
+	dl->count = 0;
 	return 0;
 }
 
@@ -497,7 +497,7 @@
 	}
 
 	dl->head = dl->tail = 0;
-	atomic_set(&dl->count, 0);
+	dl->count = 0;
 	vb_enable_deferred(vb);
 }
 
@@ -522,7 +522,7 @@
 	}
 	dl->head = 0;
 	dl->tail = 0;
-	atomic_set(&dl->count, 0);
+	dl->count = 0;
 	vb_enable_deferred(vb);
 }
 
@@ -727,7 +727,7 @@
 	dl->tail = (++tail) & DRING_MASK;
 	d->buffer1 = cpu_to_le32(vbb->dma_addr);
 	SET_OWNED(d); /* That's it until the hardware is done with it. */
-	atomic_inc(&dl->count);
+	++dl->count;
 	return 0;
 }
 
@@ -753,7 +753,7 @@
 	d->buffer1 = cpu_to_le32(vbb->dma_addr);
 	dl->tail = (dl->tail + 1) & DRING_MASK;
 	SET_OWNED(d); /* That's it until the hardware is done with it. */
-	atomic_inc(&dl->count);
+	++dl->count;
 	return 0;
 }
 
@@ -960,7 +960,7 @@
 		dl->pending[head] = NULL;
 	}
 	dl->head = (++head) & DRING_MASK;
-	atomic_dec(&dl->count);
+	--dl->count;
 	vb_net_capture_vbb(vb, vbb, 1, d->des0, d->container);
 	return vbb;
 }
@@ -981,7 +981,7 @@
 	vbb = dl->pending[head];
 	dl->head = (++head) & DRING_MASK;
 	d->buffer1 = 0;
-	atomic_dec(&dl->count);
+	--dl->count;
 #	ifdef VOICEBUS_NET_DEBUG
 	vb_net_capture_vbb(vb, vbb, 0, d->des0, d->container);
 #	endif
@@ -1495,10 +1495,10 @@
 	while ((vbb = vb_get_completed_txb(vb)))
 		list_add_tail(&vbb->entry, &vb->tx_complete);
 
-	if (unlikely(atomic_read(&dl->count) < 2)) {
+	if (unlikely(dl->count < 2)) {
 		softunderrun = 1;
 		d = vb_descriptor(dl, dl->head);
-		if (1 == atomic_read(&dl->count))
+		if (1 == dl->count)
 			return;
 
 		behind = 2;

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=9888&r1=9887&r2=9888
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.h Mon Apr  4 11:25:47 2011
@@ -100,7 +100,7 @@
 	unsigned int 	tail;
 	void  		*pending[DRING_SIZE];
 	dma_addr_t	desc_dma;
-	atomic_t 	count;
+	unsigned long	count;
 	unsigned int	padding;
 };
 




More information about the svn-commits mailing list