summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-02 18:04:05 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-02 18:04:05 +0000
commitd471b05a1c259cc18aa1f6ad54733cd608b7a69f (patch)
tree8772a04e1cdc55cd58d7b2d1379ac5c8537a0c49
parentb576789b439676cda0595c1f9ad402f8864e7f42 (diff)
Fix for #12387. Cannot unload wct4xxp module on FC8
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4223 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--kernel/wct4xxp/base.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/kernel/wct4xxp/base.c b/kernel/wct4xxp/base.c
index 5eb4fec..11277a8 100644
--- a/kernel/wct4xxp/base.c
+++ b/kernel/wct4xxp/base.c
@@ -2918,6 +2918,19 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2)
struct t4 *wc = dev_id;
unsigned int status;
+ /* Check this first in case we get a spurious interrupt */
+ if (unlikely(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);
+ spin_lock(&wc->reglock);
+ __t4_set_timing_source(wc, 4, 0, 0);
+ spin_unlock(&wc->reglock);
+ return IRQ_RETVAL(1);
+ }
+
/* Make sure it's really for us */
status = __t4_pci_in(wc, WC_INTR);
@@ -3015,16 +3028,6 @@ ZAP_IRQ_HANDLER(t4_interrupt_gen2)
__t4_set_timing_source_auto(wc);
}
- if (unlikely(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(&wc->reglock);
if (unlikely(test_bit(T4_CHECK_VPM, &wc->checkflag)))
@@ -3781,30 +3784,16 @@ static void __devexit t4_remove_one(struct pci_dev *pdev)
destroy_workqueue(wc->workq);
}
#endif
-#if 0
- /* Stop any DMA */
- __t1xxp_stop_dma(wc);
- /* In case hardware is still there */
- __t1xxp_disable_interrupts(wc);
-
- t1xxp_stop_stuff(wc);
-#endif
+ free_irq(pdev->irq, wc);
if (wc->membase)
iounmap((void *)wc->membase);
pci_release_regions(pdev);
-#if 0
- if (wc->memaddr)
- release_mem_region(wc->memaddr, wc->memlen);
-#endif
/* Immediately free resources */
pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma);
-#if 1
- free_irq(pdev->irq, wc);
-#endif
order_index[wc->order]--;