[svn-commits] mattf: trunk r2682 - /trunk/wct4xxp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 3 12:00:53 CDT 2007


Author: mattf
Date: Tue Jul  3 12:00:52 2007
New Revision: 2682

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2682
Log:
Fix shutdown issue

Modified:
    trunk/wct4xxp/base.c

Modified: trunk/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/base.c?view=diff&rev=2682&r1=2681&r2=2682
==============================================================================
--- trunk/wct4xxp/base.c (original)
+++ trunk/wct4xxp/base.c Tue Jul  3 12:00:52 2007
@@ -36,6 +36,7 @@
 #include <linux/spinlock.h>
 #include <asm/io.h>
 #include <linux/version.h>
+#include <linux/delay.h>
 #ifdef STANDALONE_ZAPATA
 #include "zaptel.h"
 #else
@@ -1382,9 +1383,6 @@
 	wasrunning = span->flags & ZT_FLAG_RUNNING;
 
 	span->flags &= ~ZT_FLAG_RUNNING;
-	if (wasrunning)
-		wc->spansstarted--;
-
 	__t4_set_led(wc, span->offset, WC_OFF);
 	if (((wc->numspans == 4) && 
 	    (!(wc->tspans[0]->span.flags & ZT_FLAG_RUNNING)) &&
@@ -1400,6 +1398,12 @@
 		wc->stopdma = 1;
 	} else wc->checktiming = 1;
 	spin_unlock_irqrestore(&wc->reglock, flags);
+
+	/* Wait for interrupt routine to shut itself down */
+	msleep(10);
+	if (wasrunning)
+		wc->spansstarted--;
+
 	if (debug & DEBUG_MAIN)
 		printk("Span %d (%s) shutdown\n", span->spanno, span->name);
 	return 0;




More information about the svn-commits mailing list