diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-04-06 19:05:29 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-04-06 19:05:29 +0000 |
commit | 79e5e868090efc31c32289061e67fd386768ebcb (patch) | |
tree | d3f770ca8342b1d91d5273a7e51e3fb2ce80f59c | |
parent | 9a9d3061ebfbdfd39c8cd79fcb17f259140685c0 (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.c | 15 |
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); |