summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-10-03 15:33:17 +1000
committerPaul Mackerras <paulus@samba.org>2007-10-03 15:33:17 +1000
commit70f227d8846a8a9b1f36f71c42e11cc7c6e9408d (patch)
treefb4dd5c8240bdaada819fb569c01a392b52847b9 /crypto
parenta0c7ce9c877ceef8428798ac91fb794f83609aed (diff)
parentf778089cb2445dfc6dfd30a7a567925fd8589f1e (diff)
downloadblackbird-op-linux-70f227d8846a8a9b1f36f71c42e11cc7c6e9408d.tar.gz
blackbird-op-linux-70f227d8846a8a9b1f36f71c42e11cc7c6e9408d.zip
Merge branch 'linux-2.6' into for-2.6.24
Diffstat (limited to 'crypto')
-rw-r--r--crypto/async_tx/async_tx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c
index 035007145e78..bc18cbb8ea79 100644
--- a/crypto/async_tx/async_tx.c
+++ b/crypto/async_tx/async_tx.c
@@ -80,6 +80,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
{
enum dma_status status;
struct dma_async_tx_descriptor *iter;
+ struct dma_async_tx_descriptor *parent;
if (!tx)
return DMA_SUCCESS;
@@ -87,8 +88,15 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
/* poll through the dependency chain, return when tx is complete */
do {
iter = tx;
- while (iter->cookie == -EBUSY)
- iter = iter->parent;
+
+ /* find the root of the unsubmitted dependency chain */
+ while (iter->cookie == -EBUSY) {
+ parent = iter->parent;
+ if (parent && parent->cookie == -EBUSY)
+ iter = iter->parent;
+ else
+ break;
+ }
status = dma_sync_wait(iter->chan, iter->cookie);
} while (status == DMA_IN_PROGRESS || (iter != tx));
OpenPOWER on IntegriCloud