summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-03 17:00:52 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-07-03 17:00:52 +0000
commit0b1e52fd00a2251d408b8f98de55ed24a1103e53 (patch)
treef44b4d56098a3277302bd20d3ff212b9a2a7fd26
parentb9efdd86de5817416fb0df4b1f0dfa04653ffc93 (diff)
Fix shutdown issue
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2682 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--wct4xxp/base.c10
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;