[svn-commits] sruffell: linux/trunk r9969 - /linux/trunk/drivers/dahdi/wctdm24xxp/base.c

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


Author: sruffell
Date: Thu Jun  2 15:03:52 2011
New Revision: 9969

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

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

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

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9969&r1=9968&r2=9969
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Jun  2 15:03:52 2011
@@ -2335,7 +2335,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 */
@@ -2344,16 +2344,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) {
@@ -2361,7 +2360,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,
@@ -2701,12 +2700,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;
@@ -2837,7 +2836,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))
@@ -4280,7 +4279,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