[svn-commits] sruffell: linux/trunk r8080 - in /linux/trunk/drivers/dahdi: voicebus/ wcte12xp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 24 13:13:09 CST 2010


Author: sruffell
Date: Wed Feb 24 13:13:05 2010
New Revision: 8080

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8080
Log:
wctdm24xxp, wcte12xp:  Abort attach if interface fails to come out of reset.

If the reset bit never clears, then just assume we cannot talk to the board and
error on the attach.  DAHDI-515.

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

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=8080&r1=8079&r2=8080
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.c Wed Feb 24 13:13:05 2010
@@ -617,8 +617,8 @@
 	} while ((reg & 0x00000001) && time_before(jiffies, timeout));
 
 	if (reg & 0x00000001) {
-		dev_warn(&vb->pdev->dev, "Hardware did not come out of reset "
-			 "within 100ms!");
+		dev_warn(&vb->pdev->dev, "Did not come out of reset "
+			 "within 100ms\n");
 		return -EIO;
 	}
 
@@ -1577,14 +1577,6 @@
 	vb->idle_vbb = dma_alloc_coherent(&vb->pdev->dev, VOICEBUS_SFRAME_SIZE,
 					  &vb->idle_vbb_dma_addr, GFP_KERNEL);
 
-	retval = vb_initialize_tx_descriptors(vb);
-	if (retval)
-		goto cleanup;
-
-	retval = vb_initialize_rx_descriptors(vb);
-	if (retval)
-		goto cleanup;
-
 	/* ----------------------------------------------------------------
 	   Configure the hardware interface.
 	   ---------------------------------------------------------------- */
@@ -1597,6 +1589,20 @@
 	pci_set_master(vb->pdev);
 	vb_enable_io_access(vb);
 
+	if (vb_reset_interface(vb)) {
+		retval = -EIO;
+		dev_warn(&vb->pdev->dev, "Failed reset.\n");
+		goto cleanup;
+	}
+
+	retval = vb_initialize_tx_descriptors(vb);
+	if (retval)
+		goto cleanup;
+
+	retval = vb_initialize_rx_descriptors(vb);
+	if (retval)
+		goto cleanup;
+
 #if VOICEBUS_DEFERRED != TIMER
 	retval = request_irq(vb->pdev->irq, vb_isr, DAHDI_IRQ_SHARED,
 			     board_name, vb);
@@ -1632,7 +1638,8 @@
 	if (vb->pdev)
 		pci_disable_device(vb->pdev);
 
-	WARN_ON(0 == retval);
+	if (0 == retval)
+		retval = -EIO;
 	return retval;
 }
 EXPORT_SYMBOL(voicebus_init);

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=8080&r1=8079&r2=8080
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Wed Feb 24 13:13:05 2010
@@ -1846,7 +1846,6 @@
 	wc->vb.debug = &debug;
 	res = voicebus_init(&wc->vb, wc->name);
 	if (res) {
-		WARN_ON(1);
 		free_wc(wc);
 		ifaces[index] = NULL;
 		return res;




More information about the svn-commits mailing list