提交 76507fdf 编写于 作者: R Robert Jarzmik 提交者: Vinod Koul

dmaengine: pxa_dma: fix hotchain corner case

In the case where a descriptor is chained on a running channel, and as
explained in the comment in the code 10 lines above, the success of the
chaining is ensured either if :
 - the DMA is still running
 - or if the chained transfer is completed

Unfortunately the transfer completness test was done on the descriptor
to which the transfer was chained, and not the transfer being chained at
the end, ie. hot-chained.

This corner case is extremely hard to trigger, as usually the DMA chain
is still running, and the first case takes care of returning success of
the hot-chaining. It was seen by hot-chaining several "small transfers"
to a running "big transfer", not in a real-life usecase but by testing
the robustness of the driver.
Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 626d2f07
...@@ -638,7 +638,7 @@ static bool pxad_try_hotchain(struct virt_dma_chan *vc, ...@@ -638,7 +638,7 @@ static bool pxad_try_hotchain(struct virt_dma_chan *vc,
vd_last_issued = list_entry(vc->desc_issued.prev, vd_last_issued = list_entry(vc->desc_issued.prev,
struct virt_dma_desc, node); struct virt_dma_desc, node);
pxad_desc_chain(vd_last_issued, vd); pxad_desc_chain(vd_last_issued, vd);
if (is_chan_running(chan) || is_desc_completed(vd_last_issued)) if (is_chan_running(chan) || is_desc_completed(vd))
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册