[svn-commits] sruffell: linux/trunk r9949 - /linux/trunk/drivers/dahdi/wcte12xp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 2 15:02:22 CDT 2011


Author: sruffell
Date: Thu Jun  2 15:02:18 2011
New Revision: 9949

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9949
Log:
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 at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=9949&r1=9948&r2=9949
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Thu Jun  2 15:02:18 2011
@@ -1390,6 +1390,7 @@
 	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 @@
 	 * 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;
-
-	res = vpmadt032_init(wc->vpmadt032, &wc->vb);
+	vpm->setchanconfig_from_state = setchanconfig_from_state;
+
+	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 @@
 		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;




More information about the svn-commits mailing list