]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: pxa_dma: fix hotchain corner case
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sun, 7 Aug 2016 19:01:48 +0000 (21:01 +0200)
committerVinod Koul <vinod.koul@intel.com>
Fri, 19 Aug 2016 06:31:59 +0000 (12:01 +0530)
commit81d8e4d81196766d983066dccfe2c4d26f41f22c
treefaf60db54b5da1dbb18555eb60f9a418c6a50473
parent4ca97a5a8ceab16e9ec3c69d86521272c391826d
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>
drivers/dma/pxa_dma.c