]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: virt-dma: don't always free descriptor upon completion
authorRobert Jarzmik <robert.jarzmik@free.fr>
Tue, 26 May 2015 21:06:33 +0000 (23:06 +0200)
committerVinod Koul <vinod.koul@intel.com>
Wed, 17 Jun 2015 16:45:59 +0000 (22:15 +0530)
commitcc05fdd70c478e21c2e1184acd7f87a0a8707156
treee13e2f35ed86239fdd3fbf882023daff6802ca5c
parent928911d51e4eee92a356503e5330913929ee190a
dmaengine: virt-dma: don't always free descriptor upon completion

This patch attempts to enhance the case of a transfer submitted multiple
times, and where the cost of creating the descriptors chain is not
negligible.

This happens with big video buffers (several megabytes, ie. several
thousands of linked descriptors in one scatter-gather list). In these
cases, a video driver would want to do :
 - tx = dmaengine_prep_slave_sg()
 - dma_engine_submit(tx);
 - dma_async_issue_pending()
 - wait for video completion
 - read video data (or not, skipping a frame is also possible)
 - dma_engine_submit(tx)
   => here, the descriptors chain recalculation will take time
   => the dma coherent allocation over and over might create holes in
      the dma pool, which is counter-productive.
 - dma_async_issue_pending()
 - etc ...

In order to cope with this case, virt-dma is modified to prevent freeing
the descriptors upon completion if DMA_CTRL_ACK flag is set in the
transfer.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/virt-dma.c
drivers/dma/virt-dma.h