summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-21 05:31:51 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-21 05:31:51 +0000
commit20f2f615efc9610f4a4634bc1c49053b0fc89442 (patch)
tree35cceca273be348c302ad7b4f59ac507fa2f6e4f
parent239a3773a3e576d6fb77244a1382623bc616c451 (diff)
wctdm24xxp, wcte12xp: Lock interrupts when recovering from an underrun.
This reduces the chance that another interrupt will interfere with the recovery process. Otherwise it is possible that the hardware advances past the position that we think it is currently at. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9535 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9685 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/voicebus/voicebus.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c
index 2e4385e..0faa8f7 100644
--- a/drivers/dahdi/voicebus/voicebus.c
+++ b/drivers/dahdi/voicebus/voicebus.c
@@ -1486,12 +1486,19 @@ static void vb_tasklet_normal(unsigned long data)
if (unlikely(softunderrun)) {
int i;
- vb_increase_latency(vb, behind, &buffers);
+ unsigned long flags;
+ /* Disable interrupts on the local processor. We don't want
+ * the following process interrupted. We're 'racing' against
+ * the hardware here.... */
+ local_irq_save(flags);
+ vb_increase_latency(vb, behind, &buffers);
d = vb_descriptor(dl, dl->head);
while (!OWNED(d)) {
- if (d->buffer1 != vb->idle_vbb_dma_addr)
+ if (d->buffer1 != vb->idle_vbb_dma_addr) {
+ local_irq_restore(flags);
goto tx_error_exit;
+ }
SET_OWNED(d);
dl->head = (dl->head + 1) & DRING_MASK;
d = vb_descriptor(dl, dl->head);
@@ -1506,6 +1513,7 @@ static void vb_tasklet_normal(unsigned long data)
dl->head = (dl->head + 1) & DRING_MASK;
}
dl->tail = dl->head;
+ local_irq_restore(flags);
}
d = vb_descriptor(dl, dl->tail);