[svn-commits] sruffell: branch linux/2.4 r9685 - /linux/branches/2.4/drivers/dahdi/voicebus/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 20 23:31:55 CST 2011


Author: sruffell
Date: Thu Jan 20 23:31:51 2011
New Revision: 9685

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9685
Log:
wctdm24xxp, wcte12xp: Lock interrupts when recovering from an underrun.

This reduces the chance that another interrupt will interfere with the
recovery process.  Otherwise it is possible that the hardware advances
past the position that we think it is currently at.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>
Acked-By: Russ Meyerriecks <rmeyerriecks at digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9535

Modified:
    linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c

Modified: linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=9685&r1=9684&r2=9685
==============================================================================
--- linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/branches/2.4/drivers/dahdi/voicebus/voicebus.c Thu Jan 20 23:31:51 2011
@@ -1486,12 +1486,19 @@
 
 	if (unlikely(softunderrun)) {
 		int i;
+		unsigned long flags;
+
+		/* Disable interrupts on the local processor.  We don't want
+		 * the following process interrupted. We're 'racing' against
+		 * the hardware here.... */
+		local_irq_save(flags);
 		vb_increase_latency(vb, behind, &buffers);
-
 		d = vb_descriptor(dl, dl->head);
 		while (!OWNED(d)) {
-			if (d->buffer1 != vb->idle_vbb_dma_addr)
+			if (d->buffer1 != vb->idle_vbb_dma_addr) {
+				local_irq_restore(flags);
 				goto tx_error_exit;
+			}
 			SET_OWNED(d);
 			dl->head = (dl->head + 1) & DRING_MASK;
 			d = vb_descriptor(dl, dl->head);
@@ -1506,6 +1513,7 @@
 			dl->head = (dl->head + 1) & DRING_MASK;
 		}
 		dl->tail = dl->head;
+		local_irq_restore(flags);
 	}
 
 	d = vb_descriptor(dl, dl->tail);




More information about the svn-commits mailing list