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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 10 09:56:47 CDT 2009


Author: sruffell
Date: Thu Sep 10 09:56:45 2009
New Revision: 7108

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7108
Log:
wip: Still working on why the startup hangs.

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=7108&r1=7107&r2=7108
==============================================================================
--- 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 10 09:56:45 2009
@@ -560,6 +560,8 @@
 	}
 
 	list_for_each_entry(d, &vb->txd.list, node) {
+		dev_dbg(&vb->pdev->dev, "desc: %08x (next: %08x)\n",
+			(u32)d->desc, (u32)d->desc->buffer2);
 		d->desc->buffer1 = vb->idle_vbb_dma_addr;
 		d->pending = vb->idle_vbb;
 		SET_OWNED(d->desc);
@@ -1026,8 +1028,10 @@
 
 	d = dl->tail;
 
+	/* 
 	if (printk_ratelimit())
 		dev_dbg(&vb->pdev->dev, "d->desc->buffer1 = %08x\n", d->desc->buffer1);
+	*/
 	/* Do not overwrite a buffer that is still in progress. */
 	if (unlikely(d->desc->buffer1 != vb->idle_vbb_dma_addr)) {
 		voicebus_free(vb, vbb);
@@ -1110,7 +1114,6 @@
 	struct voicebus_descriptor_list *const dl = &vb->txd;
 	struct voicebus_chained_descriptor *next;
 	int count = 1;
-
 	next = get_next_descriptor(dl, d);
 	while (!OWNED(next->desc)) {
 		next->desc->buffer1 = vb->idle_vbb_dma_addr;
@@ -1122,14 +1125,20 @@
 
 	vb->underruncount = count;
 
-	count = 3;
-	while (--count)
+	count = 8;
+	while (--count) {
 		next = get_next_descriptor(dl, next);
+		SET_OWNED(next->desc); /* !!! this shouldn't be necessary */
+	}
 
 	vb->txd.tail = next;
+	vb->txd.head = next;
 
 	WARN_ON(!OWNED(get_prev_descriptor(&vb->txd, next)->desc));
 	set_bit(TX_RECOVERING, &vb->flags);
+
+	dev_dbg(&vb->pdev->dev, "Setting tail to %08x (head: %08x)\n",
+		(u32)next->desc, (u32)vb->txd.head->desc);
 }
 
 static void stop_tx_descriptor_list_recovery(struct voicebus *vb)
@@ -1150,8 +1159,12 @@
 
 	assert_in_vb_deferred(vb);
 	d = dl->head;
-	if (printk_ratelimit())
-		dev_dbg(&vb->pdev->dev, "buffer1: %08x idle: %08x\n", d->desc->buffer1, (u32)vb->idle_vbb_dma_addr);
+	/*
+	if (printk_ratelimit()) {
+		dev_dbg(&vb->pdev->dev, "buffer1: %08x idle: %08x\n",
+			d->desc->buffer1, (u32)vb->idle_vbb_dma_addr);
+	}
+	*/
 
 	if (d->desc->buffer1 == vb->idle_vbb_dma_addr) {
 		if (unlikely(!OWNED(d->desc))) {
@@ -1516,7 +1529,7 @@
 
 	assert_in_vb_deferred(vb);
 
-	latency = atomic_read(&vb->txd.count);
+	latency = vb->min_tx_buffer_count;
 	if (MAX_LATENCY == latency) {
 		if (__warn_once) {
 			/* We must subtract two from this number since there
@@ -1545,12 +1558,14 @@
 		 * that case.
 		 */
 		voicebus_set_minlatency(vb, latency + increase);
-		vbb = voicebus_alloc(vb);
-
-		if (unlikely(NULL == vbb))
-			BUG_ON(1);
-		else
-			vb->handle_transmit(vbb, vb->context);
+		while (increase--) {
+			vbb = voicebus_alloc(vb);
+
+			if (unlikely(NULL == vbb))
+				BUG_ON(1);
+			else
+				vb->handle_transmit(vbb, vb->context);
+		}
 
 	}
 }




More information about the svn-commits mailing list