aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-24 17:25:30 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-24 17:25:30 -0700
commit4f33e21c923c1656fb9e3d6fe2302e34e9e079a4 (patch)
tree2f7a64a9c97f666b45a204dc7908854286046a2f /crypto
parentccec6e2c4a74adf76ed4e2478091a311b1806212 (diff)
parente4d84909dd48b5e5806a5d18b881e1ca1610ba9b (diff)
Merge branch 'async-tx-fixes-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop
* 'async-tx-fixes-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop: raid5: fix 2 bugs in ops_complete_biofill async_tx: fix dma_wait_for_async_tx async_tx: usage documentation and developer notes (v2)
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 035007145e7..bc18cbb8ea7 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));