[dahdi-commits] sruffell: branch linux/sruffell/dahdi-linux-chainedvb r7092 - /linux/team/sru...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Sep 3 16:15:19 CDT 2009


Author: sruffell
Date: Thu Sep  3 16:15:15 2009
New Revision: 7092

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7092
Log:
wip: Latency bumps work the same currently...

Modified:
    linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c

Modified: linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=7092&r1=7091&r2=7092
==============================================================================
--- linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c Thu Sep  3 16:15:15 2009
@@ -161,6 +161,7 @@
 	struct voicebus_chained_descriptor *tail;
 	enum dma_data_direction	direction;
 	unsigned int		padding;
+	atomic_t		count;
 };
 #else
 struct voicebus_descriptor_list {
@@ -368,6 +369,7 @@
 	}
 	dl->head = list_entry(list->next, typeof(*d), node);
 	dl->tail = list_entry(list->next, typeof(*d), node);
+	atomic_set(&dl->count, 0);
 }
 #else
 static void
@@ -403,7 +405,7 @@
 
 	vb_cleanup_descriptors(vb, dl);
 	while (!list_empty(list)) {
-		d = list_entry(list->next, struct voicebus_chained_descriptor, node);
+		d = list_entry(list->next, typeof(*d), node);
 		list_del(&d->node);
 		dma_free_coherent(&vb->pdev->dev, sizeof(*d->desc),
 				  d->desc, d->dma_addr);
@@ -466,6 +468,7 @@
 		prev = d;
 	}
 
+	atomic_set(&dl->count, 0);
 	return 0;
 
 error_nomem:
@@ -905,6 +908,7 @@
 
 	/* That's it until the hardware is done with it. */
 	SET_OWNED(d->desc);
+	atomic_inc(&dl->count);
 	return -EFAULT;
 }
 
@@ -922,6 +926,7 @@
 		vbb = d->pending;
 		dl->head = get_next_descriptor(dl, d);
 		d->desc->buffer1 = 0;
+		atomic_dec(&dl->count);
 		return vbb;
 	} else {
 		return NULL;
@@ -1316,22 +1321,22 @@
 }
 EXPORT_SYMBOL(voicebus_release);
 
-#if defined(USE_CHAINED_DESCRIPTORS)
-static void __vb_increase_latency(struct voicebus *vb)
-{
-}
-#else
 static void
 __vb_increase_latency(struct voicebus *vb)
 {
 	static int __warn_once = 1;
 	void *vbb;
 	int latency;
+#if defined(USE_CHAINED_DESCRIPTORS)
+	const int MAX_LATENCY = DLIST_SIZE;
+#else
+	const int MAX_LATENCY = DRING_SIZE;
+#endif
 
 	assert_in_vb_deferred(vb);
 
 	latency = atomic_read(&vb->txd.count);
-	if (DRING_SIZE == latency) {
+	if (MAX_LATENCY == latency) {
 		if (__warn_once) {
 			/* We must subtract two from this number since there
 			 * are always two buffers in the TX FIFO.
@@ -1339,7 +1344,7 @@
 			VB_PRINTK(vb, ERR,
 				"ERROR: Unable to service card within %d ms "\
 				"and unable to further increase latency.\n",
-				DRING_SIZE-2);
+				MAX_LATENCY-2);
 			__warn_once = 0;
 		}
 	} else {
@@ -1368,7 +1373,6 @@
 
 	}
 }
-#endif
 
 /*!
  * \brief Actually process the completed transmit and receive buffers.




More information about the dahdi-commits mailing list