diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2016-08-07 21:01:48 +0200 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-08-19 08:31:59 +0200 |
commit | 76507fdfc9b629209ae20cd469da2f6d093a507c (patch) | |
tree | faf60db54b5da1dbb18555eb60f9a418c6a50473 /drivers/dma/pxa_dma.c | |
parent | dmaengine: usb-dmac: check CHCR.DE bit in usb_dmac_isr_channel() (diff) | |
download | linux-76507fdfc9b629209ae20cd469da2f6d093a507c.tar.xz linux-76507fdfc9b629209ae20cd469da2f6d093a507c.zip |
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: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/pxa_dma.c')
-rw-r--r-- | drivers/dma/pxa_dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index dc7850a422b8..2093e528ae00 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -638,7 +638,7 @@ static bool pxad_try_hotchain(struct virt_dma_chan *vc, vd_last_issued = list_entry(vc->desc_issued.prev, struct virt_dma_desc, node); 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; } |