Skip to content

Commit

Permalink
dmaengine: fix dependency chaining
Browse files Browse the repository at this point in the history
In dmaengine we track the dependencies between the descriptors
using the 'next' pointers of the structure. These pointers are
set to NULL as soon as the corresponding descriptor has been
submitted to the channel (in dma_run_dependencies()).

But, the first 'next' in chain is still remaining set, regardless
the fact, that tx->next has been already submitted. This may lead to
multiple submissions of the same descriptor. This patch fixes this.

Actually, some previous implementation of the xxx_run_dependencies()
function already had this fix in place. The fdb..0eaf3 commit, beside the
correct things, broke this.

Cc: <stable@kernel.org>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Yuri Tikhonov authored and Dan Williams committed Jan 12, 2009
1 parent c597650 commit dd59b85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,8 @@ void dma_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
Expand Down

0 comments on commit dd59b85

Please sign in to comment.