* dmaengine: fix dependency chaining
@ 2009-01-12 21:22 Yuri Tikhonov
2009-01-12 22:12 ` Dan Williams
0 siblings, 1 reply; 2+ messages in thread
From: Yuri Tikhonov @ 2009-01-12 21:22 UTC (permalink / raw)
To: linux-raid; +Cc: Dan Williams, dzu, wd, Ilya Yanok
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.
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
---
drivers/dma/dmaengine.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 403dbe7..6df144a 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -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
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: dmaengine: fix dependency chaining
2009-01-12 21:22 dmaengine: fix dependency chaining Yuri Tikhonov
@ 2009-01-12 22:12 ` Dan Williams
0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2009-01-12 22:12 UTC (permalink / raw)
To: Yuri Tikhonov; +Cc: linux-raid, dzu, wd, Ilya Yanok
On Mon, Jan 12, 2009 at 2:22 PM, Yuri Tikhonov <yur@emcraft.com> wrote:
> 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.
>
> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Applied, thanks Yuri.
--
Dan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-12 22:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 21:22 dmaengine: fix dependency chaining Yuri Tikhonov
2009-01-12 22:12 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).