[zaptel-commits] branch 1.2 r974 - /branches/1.2/wct4xxp.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Mar 3 21:57:19 MST 2006


Author: markster
Date: Fri Mar  3 22:57:19 2006
New Revision: 974

URL: http://svn.digium.com/view/zaptel?rev=974&view=rev
Log:
Fix NMI issues with some IBM xSeries servers

Modified:
    branches/1.2/wct4xxp.c

Modified: branches/1.2/wct4xxp.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wct4xxp.c?rev=974&r1=973&r2=974&view=diff
==============================================================================
--- branches/1.2/wct4xxp.c (original)
+++ branches/1.2/wct4xxp.c Fri Mar  3 22:57:19 2006
@@ -288,6 +288,7 @@
 	int flags;			/* Device flags */
 	int master;				/* Are we master */
 	int ledreg;				/* LED Register */
+	int stopdma;			/* Set to stop DMA */
 	unsigned int dmactrl;
 	int e1recover;			/* E1 recovery timer */
 	dma_addr_t 	readdma;
@@ -379,7 +380,10 @@
 {
 	unsigned int tmp;
 	wc->membase[addr] = cpu_to_le32(value);
-#if 1
+	tmp = le32_to_cpu(wc->membase[WC_VERSION]);
+	if ((tmp & 0xffff0000) != 0xc01a0000)
+		printk("TE4XXP: Version Synchronization Error!\n");
+#if 0
 	tmp = le32_to_cpu(wc->membase[addr]);
 	if ((value != tmp) && (addr != WC_LEDS) && (addr != WC_LDATA) &&
 		(addr != WC_GPIO) && (addr != WC_INTR))
@@ -432,6 +436,7 @@
 	unit &= 0x3;
 	__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
 	__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff) | ( 1 << 10) | WC_LREAD);
+	__t4_pci_out(wc, WC_VERSION, 0);
 	ret = __t4_pci_in(wc, WC_LDATA);
 	__t4_pci_out(wc, WC_LADDR, 0);
 	return ret & 0xff;
@@ -970,11 +975,7 @@
 	    (!(wc->tspans[1]->span.flags & ZT_FLAG_RUNNING)))) {
 		/* No longer in use, disable interrupts */
 		printk("TE%dXXP: Disabling interrupts since there are no active spans\n", wc->numspans);
-		wc->dmactrl = 0x0;
-		__t4_pci_out(wc, WC_DMACTRL, 0x00000000);
-		/* Acknowledge any pending interrupts */
-		__t4_pci_out(wc, WC_INTR, 0x00000000);
-		__t4_set_timing_source(wc,4);
+		wc->stopdma = 1;
 	} else wc->checktiming = 1;
 	spin_unlock_irqrestore(&wc->reglock, flags);
 	if (debug & DEBUG_MAIN)
@@ -2322,6 +2323,15 @@
 
 	if (wc->checktiming > 0)
 		__t4_set_timing_source_auto(wc);
+	if (wc->stopdma) {
+		/* Stop DMA cleanly if requested */
+		wc->dmactrl = 0x0;
+		__t4_pci_out(wc, WC_DMACTRL, 0x00000000);
+		/* Acknowledge any pending interrupts */
+		__t4_pci_out(wc, WC_INTR, 0x00000000);
+		__t4_set_timing_source(wc, 4);
+		wc->stopdma = 0x0;
+	}
 	spin_unlock_irqrestore(&wc->reglock, flags);
 
 #ifndef ENABLE_WORKQUEUES
@@ -2896,10 +2906,7 @@
 {
 
 	/* Turn off DMA, leave interrupts enabled */
-	wc->dmactrl = 0x0000000;
-	t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);	/* Turn on only the read interrupts, not the write */
-	t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
-	t4_pci_out(wc, WC_INTR, 0x00000000);
+	wc->stopdma = 1;
 
 	current->state = TASK_UNINTERRUPTIBLE;
 	schedule_timeout((25 * HZ) / 1000);



More information about the zaptel-commits mailing list