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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 25 13:28:57 CDT 2011


Author: sruffell
Date: Thu Aug 25 13:28:53 2011
New Revision: 10155

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10155
Log:
wcte12xp: Abort driver bind if read/write test fails.

When the driver begins to initialize a device it conducts a read/write
test on one of the framer registers. The driver ignores the result of
that test and results in much output spammed to the kernel logs for a
failed card since the driver doesn't then try to unbind from the device.

What was getting spammed:
     wcte12xp 0000:03:01.0: Timeout in t1_getreg
     wcte12xp 0000:03:01.0: Wrote '0' but read 'fffffffb'

Now abort the bind if the read / write test fails.

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=10155&r1=10154&r2=10155
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Thu Aug 25 13:28:53 2011
@@ -1856,7 +1856,7 @@
 static int t1_hardware_post_init(struct t1 *wc)
 {
 	int res;
-	unsigned int reg;
+	int reg;
 	int x;
 
 	/* T1 or E1 */
@@ -1878,14 +1878,25 @@
 	/* what version of the FALC are we using? */
 	reg = t1_setreg(wc, 0x4a, 0xaa);
 	reg = t1_getreg(wc, 0x4a);
+	if (reg < 0) {
+		t1_info(wc, "Failed to read FALC version (%d)\n", reg);
+		return -EIO;
+	}
 	debug_printk(wc, 1, "FALC version: %08x\n", reg);
 
 	/* make sure reads and writes work */
 	for (x = 0; x < 256; x++) {
 		t1_setreg(wc, 0x14, x);
 		reg = t1_getreg(wc, 0x14);
-		if (reg != x)
-			t1_info(wc, "Wrote '%x' but read '%x'\n", x, reg);
+		if (reg < 0) {
+			t1_info(wc, "Failed register read (%d)\n", reg);
+			return -EIO;
+		}
+		if (reg != x) {
+			t1_info(wc, "Register test failed. "
+				"Wrote '%x' but read '%x'\n", x, reg);
+			return -EIO;
+		}
 	}
 
 	t1_setleds(wc, wc->ledstate);




More information about the svn-commits mailing list