[svn-commits] sruffell: branch linux/sruffell/wctdm24xxp-cmdlist r9862 - /linux/team/sruffe...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 16 16:40:59 CDT 2011


Author: sruffell
Date: Wed Mar 16 16:40:56 2011
New Revision: 9862

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9862
Log:
wctdm24xxp: Shorten up some of the sleeps/waits.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/wctdm24xxp/base.c

Modified: linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9862&r1=9861&r2=9862
==============================================================================
--- linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/wctdm24xxp/base.c Wed Mar 16 16:40:56 2011
@@ -2317,7 +2317,7 @@
 static int
 wctdm_proslic_powerleak_test(struct wctdm *wc, struct wctdm_module *const mod)
 {
-	unsigned long origjiffies;
+	unsigned long start;
 	unsigned char vbat;
 
 	/* Turn off linefeed */
@@ -2326,16 +2326,15 @@
 	/* Power down */
 	wctdm_setreg(wc, mod, 14, 0x10);
 
-	/* Wait for one second */
-	origjiffies = jiffies;
-
-	/* TODO: Why is this sleep necessary.  WIthout it, the first read
+	start = jiffies;
+
+	/* TODO: Why is this sleep necessary.  Without it, the first read
 	 * comes back with a 0 value. */
 	msleep(20);
 
 	while ((vbat = wctdm_getreg(wc, mod, 82)) > 0x6) {
-		if ((jiffies - origjiffies) >= (HZ/2))
-			break;;
+		if (time_after(jiffies, start + HZ/4))
+			break;
 	}
 
 	if (vbat < 0x06) {
@@ -2343,7 +2342,7 @@
 			   "Excessive leakage detected on module %d: %d "
 			   "volts (%02x) after %d ms\n", mod->card,
 			   376 * vbat / 1000, vbat,
-			   (int)((jiffies - origjiffies) * 1000 / HZ));
+			   (int)((jiffies - start) * 1000 / HZ));
 		return -1;
 	} else if (debug & DEBUG_CARD) {
 		dev_info(&wc->vb.pdev->dev,
@@ -2682,12 +2681,12 @@
 	spin_lock_irqsave(&wc->reglock, flags);
 	mod->type = NONE;
 	spin_unlock_irqrestore(&wc->reglock, flags);
-	msleep(100);
+	msleep(20);
 
 	spin_lock_irqsave(&wc->reglock, flags);
 	mod->type = FXO;
 	spin_unlock_irqrestore(&wc->reglock, flags);
-	msleep(100);
+	msleep(20);
 
 	if (!sane && wctdm_voicedaa_insane(wc, mod))
 		return -2;
@@ -2818,7 +2817,7 @@
 	mod->type = FXS;
 	spin_unlock_irqrestore(&wc->reglock, flags);
 
-	msleep(100);
+	/* msleep(100); */
 
 	/* Sanity check the ProSLIC */
 	if (!sane && wctdm_proslic_insane(wc, mod))
@@ -4219,7 +4218,7 @@
 
 	/* Wait just a bit; this makes sure that cmd_dequeue is emitting SPI
 	 * commands in the appropriate mode(s). */
-	msleep(20);
+	udelay(2000);
 
 	/* Now that all the cards have been reset, we can stop checking them
 	 * all if there aren't as many */




More information about the svn-commits mailing list