summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-02-24 19:13:05 +0000
committerShaun Ruffell <sruffell@digium.com>2010-02-24 19:13:05 +0000
commit0903748420aa0d560485d8a8fd2aa3ce8900628b (patch)
tree5d7ad3cb5fa4699d9856f2007ed217c4763fb7d4 /drivers/dahdi/voicebus
parenta0e532fc44b63d9996b16ca7329d9a98e04e3362 (diff)
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. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8080 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/voicebus')
-rw-r--r--drivers/dahdi/voicebus/voicebus.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c
index 8853093..064e664 100644
--- a/drivers/dahdi/voicebus/voicebus.c
+++ b/drivers/dahdi/voicebus/voicebus.c
@@ -617,8 +617,8 @@ vb_reset_interface(struct voicebus *vb)
} 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 @@ voicebus_init(struct voicebus *vb, const char *board_name)
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 @@ voicebus_init(struct voicebus *vb, const char *board_name)
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 @@ cleanup:
if (vb->pdev)
pci_disable_device(vb->pdev);
- WARN_ON(0 == retval);
+ if (0 == retval)
+ retval = -EIO;
return retval;
}
EXPORT_SYMBOL(voicebus_init);