From 9b91a14a1ce91cad4a4910e61b5249ef3b4ce2c4 Mon Sep 17 00:00:00 2001 From: Krzysztof Helt Date: Sun, 11 Oct 2009 12:48:00 +0200 Subject: [PATCH] --- yaml --- r: 170071 b: refs/heads/master c: 8066e51ae7329220f459470a38387f8533e99141 h: refs/heads/master i: 170069: df3b4d661a530e145b7bcfe6c32a3c0d0b21376a 170067: 0d08c95b5115d21e523ed1b29026d37ff1b3ec3d 170063: 0fc91830b95a28fd956a378d0b37f8838b2fd7d0 v: v3 --- [refs] | 2 +- trunk/sound/core/isadma.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 35fc6ca8563b..1a1607962ffc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 633c7e92bdd54ba939f2bd3b78c72e1e1a1dd077 +refs/heads/master: 8066e51ae7329220f459470a38387f8533e99141 diff --git a/trunk/sound/core/isadma.c b/trunk/sound/core/isadma.c index 79f0f16af339..950e19ba91fc 100644 --- a/trunk/sound/core/isadma.c +++ b/trunk/sound/core/isadma.c @@ -85,16 +85,24 @@ EXPORT_SYMBOL(snd_dma_disable); unsigned int snd_dma_pointer(unsigned long dma, unsigned int size) { unsigned long flags; - unsigned int result; + unsigned int result, result1; flags = claim_dma_lock(); clear_dma_ff(dma); if (!isa_dma_bridge_buggy) disable_dma(dma); result = get_dma_residue(dma); + /* + * HACK - read the counter again and choose higher value in order to + * avoid reading during counter lower byte roll over if the + * isa_dma_bridge_buggy is set. + */ + result1 = get_dma_residue(dma); if (!isa_dma_bridge_buggy) enable_dma(dma); release_dma_lock(flags); + if (unlikely(result < result1)) + result = result1; #ifdef CONFIG_SND_DEBUG if (result > size) snd_printk(KERN_ERR "pointer (0x%x) for DMA #%ld is greater than transfer size (0x%x)\n", result, dma, size);