From 0b1e52fd00a2251d408b8f98de55ed24a1103e53 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 3 Jul 2007 17:00:52 +0000 Subject: Fix shutdown issue git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2682 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wct4xxp/base.c | 10 +++++++--- 1 file 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 #include #include +#include #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; -- cgit v1.2.3