diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-04-09 22:34:53 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-04-09 22:34:53 +0000 |
commit | 11f668405e83d5817c6b878a42ee4ca4eabca919 (patch) | |
tree | c1b4dfe4e2f4d8c42275f6c9d0a314aeadc8ee10 /wctdm.c | |
parent | 32903052e8fb02863c9f45ea64f13852cdd91030 (diff) |
Can't schedule inside an interrupt handler
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@165 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm.c')
-rwxr-xr-x | wctdm.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -241,7 +241,7 @@ static inline void wcfxs_receiveprep(struct wcfxs *wc, unsigned char ints) static inline void wcfxs_check_hook(struct wcfxs *wc, int card); static void wcfxs_stop_dma(struct wcfxs *wc); -static void wcfxs_start_dma(struct wcfxs *wc); +static void wcfxs_restart_dma(struct wcfxs *wc); static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs) { @@ -259,7 +259,7 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* Restart DMA */ printk("PCI Master abort\n"); wcfxs_stop_dma(wc); - wcfxs_start_dma(wc); + wcfxs_restart_dma(wc); return; } @@ -1069,6 +1069,18 @@ static void wcfxs_start_dma(struct wcfxs *wc) outb(0x01, wc->ioaddr + WC_OPER); } +static void wcfxs_restart_dma(struct wcfxs *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 wcfxs_stop_dma(struct wcfxs *wc) { outb(0x00, wc->ioaddr + WC_OPER); |