diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-11-07 00:35:42 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-11-07 00:35:42 +0000 |
commit | 011295f06703bc6d88ed9cbf7cf3671055016bd8 (patch) | |
tree | 0d0d12332b82e4e875879ee9b7f97f3d20aac573 /drivers/dahdi/wcte12xp | |
parent | a2edf44d72fcab12e84b95eaa97650301b288411 (diff) |
wcte12xp: Lock latency when loading
No longer need to restart board initialization if the latency would have
increased during initialization. DAHDI-278.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7519 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp')
-rw-r--r-- | drivers/dahdi/wcte12xp/base.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index a915ce7..7cc14d9 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -1733,7 +1733,6 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi struct t1_desc *d = (struct t1_desc *) ent->driver_data; unsigned int x; int res; - int startinglatency; unsigned int index = -1; for (x = 0; x < sizeof(ifaces) / sizeof(ifaces[0]); x++) { @@ -1748,7 +1747,6 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi return -EIO; } -retry: if (!(wc = kmalloc(sizeof(*wc), GFP_KERNEL))) { return -ENOMEM; } @@ -1793,8 +1791,9 @@ retry: if (VOICEBUS_DEFAULT_LATENCY != latency) { voicebus_set_minlatency(wc->vb, latency); } + + voicebus_lock_latency(wc->vb); voicebus_start(wc->vb); - startinglatency = voicebus_current_latency(wc->vb); t1_hardware_post_init(wc); for (x = 0; x < (wc->spantype == TYPE_E1 ? 31 : 24); x++) { @@ -1814,25 +1813,8 @@ retry: mod_timer(&wc->timer, jiffies + HZ/5); t1_software_init(wc); - if (voicebus_current_latency(wc->vb) > startinglatency) { - /* The voicebus library increased the latency during - * initialization because the host wasn't able to service the - * interrupts from the adapter quickly enough. In this case, - * we'll increase our latency and restart the initialization. - */ - printk(KERN_NOTICE "%s: Restarting board initialization " \ - "after increasing latency.\n", wc->name); - latency = voicebus_current_latency(wc->vb); - dahdi_unregister(&wc->span); - voicebus_release(wc->vb); - wc->vb = NULL; - free_wc(wc); - wc = NULL; - goto retry; - } - module_printk("Found a %s\n", wc->variety); - + voicebus_unlock_latency(wc->vb); return 0; } |