From 79e5e868090efc31c32289061e67fd386768ebcb Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 6 Apr 2010 19:05:29 +0000 Subject: 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 --- drivers/dahdi/wcte12xp/base.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); -- cgit v1.2.3