From 11f668405e83d5817c6b878a42ee4ca4eabca919 Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 9 Apr 2003 22:34:53 +0000 Subject: Can't schedule inside an interrupt handler git-svn-id: http://svn.digium.com/svn/zaptel/trunk@165 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wcfxo.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'wcfxo.c') diff --git a/wcfxo.c b/wcfxo.c index 945f22a..4e946e5 100755 --- a/wcfxo.c +++ b/wcfxo.c @@ -363,7 +363,7 @@ static void wcfxo_tasklet(unsigned long data) #endif static void wcfxo_stop_dma(struct wcfxo *wc); -static void wcfxo_start_dma(struct wcfxo *wc); +static void wcfxo_restart_dma(struct wcfxo *wc); static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -406,7 +406,7 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs) printk("PCI Master abort\n"); /* Stop DMA and start it again */ wcfxo_stop_dma(wc); - wcfxo_start_dma(wc); + wcfxo_restart_dma(wc); return; } @@ -664,6 +664,19 @@ static void wcfxo_start_dma(struct wcfxo *wc) outb(0x01, wc->ioaddr + WC_OPER); } +static void wcfxo_restart_dma(struct wcfxo *wc) +{ + int x; + /* Reset Master and TDM */ + outb(0x0f, wc->ioaddr + WC_CNTL); + /* Can't really wait, so simulate a wait */ + for (x=0;x<100;x++) + inb(wc->ioaddr + WC_CNTL); + outb(0x01, wc->ioaddr + WC_CNTL); + outb(0x01, wc->ioaddr + WC_OPER); +} + + static void wcfxo_stop_dma(struct wcfxo *wc) { outb(0x00, wc->ioaddr + WC_OPER); -- cgit v1.2.3