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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 20 11:02:03 CDT 2011


Author: sruffell
Date: Mon Jun 20 11:01:59 2011
New Revision: 9981

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9981
Log:
wcte12xp: Start alarm timer after marking board initialized.

r9946, "wcte12xp: Move the VPMADT032 test/configuration to module load
time." introduced a race condition where it was possible for the timer
that initiates the check for the alarms to fire before the board was
marked initialized.  This would result in a board that would never again
check it's alarm state since the first time the timer runs INITIALIZED
may not be set and it will not reschedule a check since it believes the
driver is unloading.

This happened because the check for the VPM was moved between when the
timer was first setup and when INITIALIZED was then set.

Now we make sure INITIALIZED is set before the timer is first setup, and
move those two operations together.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks 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=9981&r1=9980&r2=9981
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Mon Jun 20 11:01:59 2011
@@ -1666,8 +1666,6 @@
 		return -1;
 	}
 
-	set_bit(INITIALIZED, &wc->bit_flags);
-
 	return 0;
 }
 
@@ -2454,8 +2452,16 @@
 		}
 	}
 
+	res = t1_software_init(wc);
+	if (res) {
+		voicebus_release(&wc->vb);
+		free_wc(wc);
+		return res;
+	}
+
+	set_bit(INITIALIZED, &wc->bit_flags);
 	mod_timer(&wc->timer, jiffies + HZ/5);
-	t1_software_init(wc);
+
 	t1_info(wc, "Found a %s\n", wc->variety);
 	voicebus_unlock_latency(&wc->vb);
 




More information about the svn-commits mailing list