summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcte12xp/base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:02:18 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:02:18 +0000
commitd3cb93127b5a6241fe9004f3ae609bdb4164f78b (patch)
treed1d30cc4feea015841abe727ba2fddcfa7a5fa54 /drivers/dahdi/wcte12xp/base.c
parent1e2247128f368a720d3bc93de531d13baff72eaa (diff)
wcte12xp: Set the t1.vpmadt032 pointer under the reglock.
Ensures that a single run of the interrupt service routine is consistent about whether there are VPMADT032 commands to process or not. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9949 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp/base.c')
-rw-r--r--drivers/dahdi/wcte12xp/base.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 9cf659b..0a23a85 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -1390,6 +1390,7 @@ static int check_and_load_vpm(struct t1 *wc)
int res;
unsigned long flags;
struct vpmadt032_options options;
+ struct vpmadt032 *vpm = NULL;
if (!vpmsupport) {
t1_info(wc, "VPM Support Disabled\n");
@@ -1417,15 +1418,20 @@ static int check_and_load_vpm(struct t1 *wc)
* done setting it up here, an hour should cover it... */
wc->vpm_check = jiffies + HZ*3600;
- wc->vpmadt032 = vpmadt032_alloc(&options, wc->name);
- if (!wc->vpmadt032)
+ vpm = vpmadt032_alloc(&options, wc->name);
+ if (!vpm)
return -ENOMEM;
- wc->vpmadt032->setchanconfig_from_state = setchanconfig_from_state;
+ vpm->setchanconfig_from_state = setchanconfig_from_state;
- res = vpmadt032_init(wc->vpmadt032, &wc->vb);
+ spin_lock_irqsave(&wc->reglock, flags);
+ wc->vpmadt032 = vpm;
+ spin_unlock_irqrestore(&wc->reglock, flags);
+
+ res = vpmadt032_init(vpm, &wc->vb);
if (-ENODEV == res) {
struct vpmadt032 *vpm = wc->vpmadt032;
+
/* There does not appear to be a VPMADT032 installed. */
clear_bit(VPM150M_ACTIVE, &wc->ctlreg);
spin_lock_irqsave(&wc->reglock, flags);
@@ -1441,7 +1447,7 @@ static int check_and_load_vpm(struct t1 *wc)
return -EAGAIN;
}
- if (config_vpmadt032(wc->vpmadt032, wc)) {
+ if (config_vpmadt032(vpm, wc)) {
clear_bit(VPM150M_ACTIVE, &wc->ctlreg);
wc->vpm_check = jiffies + HZ/2;
return -EAGAIN;