]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: virt-dma: don't always free descriptor upon completion
authorRobert Jarzmik <robert.jarzmik@free.fr>
Tue, 13 Oct 2015 19:54:28 +0000 (21:54 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 16 Nov 2015 03:02:16 +0000 (08:32 +0530)
commit3f4ed6ae7b8d4779de818c9fa76e2ae9563ffdee
treedc3038dcd1135bd00bb7e2e2d4529a81d944d6de
parent2715d332e6151136472842d51b2ec873c0652275
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_REUSE flag is set in the
transfer.

This patch is a respin of the former DMA_CTRL_ACK approach, which was
reverted due to a regression in audio drivers.

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