[zaptel-commits] trunk r975 - /trunk/wct4xxp.c
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Fri Mar 3 21:57:36 MST 2006
Author: markster
Date: Fri Mar 3 22:57:36 2006
New Revision: 975
URL: http://svn.digium.com/view/zaptel?rev=975&view=rev
Log:
Fix NMI issues with some IBM xSeries servers
Modified:
trunk/wct4xxp.c
Modified: trunk/wct4xxp.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp.c?rev=975&r1=974&r2=975&view=diff
==============================================================================
--- trunk/wct4xxp.c (original)
+++ trunk/wct4xxp.c Fri Mar 3 22:57:36 2006
@@ -299,6 +299,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;
@@ -398,7 +399,10 @@
{
unsigned int tmp;
wc->membase[addr] = cpu_to_le32(value);
-#if 1
+ tmp = __t4_pci_in(wc, WC_VERSION);
+ if ((tmp & 0xffff0000) != 0xc01a0000)
+ printk("TE4XXP: Version Synchronization Error!\n");
+#if 0
tmp = __t4_pci_in(wc, addr);
if ((value != tmp) && (addr != WC_LEDS) && (addr != WC_LDATA) &&
(addr != WC_GPIO) && (addr != WC_INTR))
@@ -446,6 +450,7 @@
unit &= 0x3;
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff) | WC_LFRMR_CS | WC_LREAD);
+ __t4_pci_out(wc, WC_VERSION, 0);
ret = __t4_pci_in(wc, WC_LDATA);
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
return ret & 0xff;
@@ -1145,11 +1150,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, 0, 0);
+ wc->stopdma = 1;
} else wc->checktiming = 1;
spin_unlock_irqrestore(&wc->reglock, flags);
if (debug & DEBUG_MAIN)
@@ -2725,6 +2726,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, 0, 0);
+ wc->stopdma = 0x0;
+ }
spin_unlock_irqrestore(&wc->reglock, flags);
#ifndef ENABLE_WORKQUEUES
@@ -3299,10 +3309,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