[svn-commits] sruffell: branch linux/sruffell/dahdi-linux-wcte12xp-latency r8800 - /linux/t...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 23 16:53:41 CDT 2010


Author: sruffell
Date: Wed Jun 23 16:53:38 2010
New Revision: 8800

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8800
Log:
wip: rework the vb_disable_deferred logic

Modified:
    linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.c
    linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.h

Modified: linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=8800&r1=8799&r2=8800
==============================================================================
--- linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.c Wed Jun 23 16:53:38 2010
@@ -336,14 +336,14 @@
 
 static inline void vb_disable_deferred(struct voicebus *vb)
 {
-	local_irq_disable();
-	spin_lock(&vb->deferred_lock);
+	if (atomic_inc_return(&vb->deferred_disabled_count) == 1)
+		disable_irq(vb->pdev->irq);
 }
 
 static inline void vb_enable_deferred(struct voicebus *vb)
 {
-	spin_unlock(&vb->deferred_lock);
-	local_irq_enable();
+	if (atomic_dec_return(&vb->deferred_disabled_count) == 0)
+		enable_irq(vb->pdev->irq);
 }
 
 #else
@@ -1145,9 +1145,7 @@
 #if !defined(CONFIG_VOICEBUS_INTERRUPT)
 	tasklet_hi_schedule(&vb->tasklet);
 #else
-	spin_lock(&vb->deferred_lock);
 	vb->tasklet.func(vb->tasklet.data);
-	spin_unlock(&vb->deferred_lock);
 #endif
 }
 
@@ -1627,9 +1625,6 @@
 	vb->max_latency = VOICEBUS_DEFAULT_MAXLATENCY;
 
 	spin_lock_init(&vb->lock);
-#if defined(CONFIG_VOICEBUS_INTERRUPT)
-	spin_lock_init(&vb->deferred_lock);
-#endif
 	set_bit(VOICEBUS_STOP, &vb->flags);
 
 	if ((NORMAL != mode) && (BOOT != mode) && (HX8 != mode))

Modified: linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=8800&r1=8799&r2=8800
==============================================================================
--- linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.h (original)
+++ linux/team/sruffell/dahdi-linux-wcte12xp-latency/drivers/dahdi/voicebus/voicebus.h Wed Jun 23 16:53:38 2010
@@ -128,7 +128,7 @@
 	enum voicebus_mode	mode;
 
 #if defined(CONFIG_VOICEBUS_INTERRUPT)
-	spinlock_t 		deferred_lock;
+	atomic_t 		deferred_disabled_count;
 #endif
 
 #if defined(CONFIG_VOICEBUS_TIMER)




More information about the svn-commits mailing list