diff options
Diffstat (limited to 'wct4xxp/base.c')
-rw-r--r-- | wct4xxp/base.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wct4xxp/base.c b/wct4xxp/base.c index e43583b..263e8fe 100644 --- a/wct4xxp/base.c +++ b/wct4xxp/base.c @@ -36,6 +36,7 @@ #include <linux/spinlock.h> #include <asm/io.h> #include <linux/version.h> +#include <linux/delay.h> #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else @@ -1382,9 +1383,6 @@ static int t4_shutdown(struct zt_span *span) wasrunning = span->flags & ZT_FLAG_RUNNING; span->flags &= ~ZT_FLAG_RUNNING; - if (wasrunning) - wc->spansstarted--; - __t4_set_led(wc, span->offset, WC_OFF); if (((wc->numspans == 4) && (!(wc->tspans[0]->span.flags & ZT_FLAG_RUNNING)) && @@ -1400,6 +1398,12 @@ static int t4_shutdown(struct zt_span *span) wc->stopdma = 1; } else wc->checktiming = 1; spin_unlock_irqrestore(&wc->reglock, flags); + + /* Wait for interrupt routine to shut itself down */ + msleep(10); + if (wasrunning) + wc->spansstarted--; + if (debug & DEBUG_MAIN) printk("Span %d (%s) shutdown\n", span->spanno, span->name); return 0; |