summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-04-06 19:05:29 +0000
committerShaun Ruffell <sruffell@digium.com>2010-04-06 19:05:29 +0000
commit79e5e868090efc31c32289061e67fd386768ebcb (patch)
treed3f770ca8342b1d91d5273a7e51e3fb2ce80f59c
parent9a9d3061ebfbdfd39c8cd79fcb17f259140685c0 (diff)
wcte12xp: Do not reconfigure the VPMADT032 if shutting down.
If we try to unload the driver soon after a high latency event, it is possible to get stuck for several seconds reloading the firmware. DAHDI-573. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8481 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/wcte12xp/base.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index b21f21a..fdc2c0c 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -1972,6 +1972,9 @@ static void vpm_check_func(struct work_struct *work)
int res;
u16 version;
+ if (!test_bit(INITIALIZED, &wc->bit_flags))
+ return;
+
if (test_bit(4, &wc->ctlreg)) {
res = gpakPingDsp(wc->vpmadt032->dspid, &version);
if (!res) {
@@ -1985,6 +1988,9 @@ static void vpm_check_func(struct work_struct *work)
}
+ if (!test_bit(INITIALIZED, &wc->bit_flags))
+ return;
+
res = vpmadt032_reset(wc->vpmadt032);
if (res) {
t1_info(wc, "Failed VPMADT032 reset. VPMADT032 is disabled.\n");
@@ -1992,14 +1998,23 @@ static void vpm_check_func(struct work_struct *work)
return;
}
+ if (!test_bit(INITIALIZED, &wc->bit_flags))
+ return;
+
res = config_vpmadt032(wc->vpmadt032, wc);
if (res) {
/* We failed the configuration, let's try again. */
t1_info(wc, "Failed to configure the ports. Retrying.\n");
+
+ if (!test_bit(INITIALIZED, &wc->bit_flags))
+ return;
queue_work(wc->vpmadt032->wq, &wc->vpm_check_work);
return;
}
+ if (!test_bit(INITIALIZED, &wc->bit_flags))
+ return;
+
/* Looks like the reset went ok so we can put the VPM module back in
* the TDM path. */
set_bit(4, &wc->ctlreg);