From 13d45d04cc0f078e6db246a3885431aab63929f6 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 3 Jul 2007 16:39:34 +0000 Subject: Fix for span shutdown issue git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2680 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wct4xxp/base.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'wct4xxp') diff --git a/wct4xxp/base.c b/wct4xxp/base.c index b74948f..0cb69dd 100644 --- a/wct4xxp/base.c +++ b/wct4xxp/base.c @@ -2443,6 +2443,21 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2) if (wc->intcount < 20) printk("2G: Pre-interrupt\n"); #endif + + spin_lock_irqsave(&wc->reglock, flags); + + 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); + inirq = 1; /* Make sure it's really for us */ @@ -2460,7 +2475,6 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2) #ifdef ENABLE_WORKQUEUES t4_pci_out(wc, WC_INTR, status & 0x00000008); #endif - if (!wc->spansstarted) { printk("Not prepped yet!\n"); #ifdef LINUX26 @@ -2598,15 +2612,6 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2) 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); if (needcheckvpm450 && (vpmdtmfsupport == 1)) { -- cgit v1.2.3