From: Yuri Tikhonov Date: Thu, 29 Jan 2009 12:37:13 +0000 (+0300) Subject: dmaengine: fix dependency chaining X-Git-Tag: v2.6.28.3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b9d6d4e097b38b199253243b361bee9795cd14;p=thirdparty%2Fkernel%2Fstable.git dmaengine: fix dependency chaining commit dd59b8537f6cb53ab863fafad86a5828f1e889a2 upstream ASYNC_TX: fix dependency chaining In ASYNC_TX we track the dependencies between the descriptors using the 'next' pointers of the structures. These pointers are set to NULL as soon as the corresponding descriptor has been submitted to the channel (in async_tx_run_dependencies()). But, the first 'next' in chain still remains set, regardless the fact, that tx->next is already submitted. This may lead to multiple submisions of the same descriptor. This patch fixes this. Signed-off-by: Yuri Tikhonov Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c index dcbf1be149f34..c5d71aad9ad07 100644 --- a/crypto/async_tx/async_tx.c +++ b/crypto/async_tx/async_tx.c @@ -124,6 +124,8 @@ void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx) if (!dep) return; + /* we'll submit tx->next now, so clear the link */ + tx->next = NULL; chan = dep->chan; /* keep submitting up until a channel switch is detected