[Asterisk-cvs] zaptel wct4xxp.c,1.29,1.30

citats at lists.digium.com citats at lists.digium.com
Tue Apr 6 12:15:39 CDT 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/home/citats/cvs/zaptel

Modified Files:
	wct4xxp.c 
Log Message:
Really fix deadlock on SMP systems with TE410P and new timing


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- wct4xxp.c	6 Apr 2004 15:59:47 -0000	1.29
+++ wct4xxp.c	6 Apr 2004 16:16:01 -0000	1.30
@@ -133,6 +133,7 @@
 	unsigned int passno;	/* number of interrupt passes */
 	char *variety;
 	int last0;		/* for detecting double-missed IRQ */
+	int checktiming;	/* Set >0 to cause the timing source to be checked */
 };
 
 static void __set_clear(struct t4 *wc, int span);
@@ -628,15 +629,12 @@
 		printk("Successfully initialized serial bus for unit %d\n", unit);
 }
 
-static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
-
 static void t4_set_timing_source(struct t4 *wc, int unit)
 {
 	unsigned int timing;
-	unsigned long flags;
 	int x;
+	wc->checktiming = 0;
 	timing = 0x34;		/* CMR1: RCLK unit, 8.192 Mhz TCLK, RCLK is 8.192 Mhz */
-	spin_lock_irqsave(&synclock, flags);
 	if (unit != wc->syncsrc) {
 		if ((unit > -1) && (unit < 4)) {
 			timing |= (unit << 6);
@@ -663,7 +661,6 @@
 		for (x=0;x<4;x++) 
 			wc->spans[x].syncsrc = unit;
 	}		
-	spin_unlock_irqrestore(&synclock, flags);
 }
 
 static void t4_set_timing_source_auto(struct t4 *wc)
@@ -1171,7 +1168,7 @@
 		if (wc->alarmtimer[span]) {
 			if (!--wc->alarmtimer[span]) {
 				wc->spans[span].alarms &= ~(ZT_ALARM_RECOVER);
-				t4_set_timing_source_auto(wc);
+				wc->checktiming = 1;
 				zt_alarm_notify(&wc->spans[span]);
 			}
 		}
@@ -1304,7 +1301,7 @@
 	oldalarms &= ~ZT_ALARM_YELLOW;
 	alarms &= ~ZT_ALARM_YELLOW;
 	if ((!oldalarms && alarms) || (oldalarms && !alarms))
-		t4_set_timing_source_auto(wc);
+		wc->checktiming = 1;
 
 	zt_alarm_notify(&wc->spans[span]);
 }
@@ -1456,6 +1453,8 @@
 	}
 
 	spin_unlock_irqrestore(&wc->reglock, flags);
+	if (wc->checktiming > 0)
+		t4_set_timing_source_auto(wc);
 #ifdef LINUX26
 	return IRQ_RETVAL(1);
 #endif		
@@ -1592,6 +1591,7 @@
 			wc->memaddr = pci_resource_start(pdev, 0);
 			wc->memlen = pci_resource_len(pdev, 0);
 			wc->membase = ioremap(wc->memaddr, wc->memlen);
+			wc->checktiming = 0;
 			/* This rids of the Double missed interrupt message after loading */
 			wc->last0 = 1;
 #if 0




More information about the svn-commits mailing list