summaryrefslogtreecommitdiffstats
path: root/drivers/dma/virt-dma.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'topic/async' into for-linusVinod Koul2016-01-061-0/+13
|\
| * dmaengine: virt-dma: Add synchronization helper functionLars-Peter Clausen2015-11-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a synchronize helper function for the virt-dma library. The function makes sure that any scheduled descriptor complete callbacks have finished running before the function returns. This needs to be called by drivers using virt-dma in their device_synchronize() callback. Depending on the driver additional operations might be necessary in addition to calling vchan_synchronize() to ensure proper synchronization. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
* | dmaengine: virt-dma: don't always free descriptor upon completionRobert Jarzmik2015-11-161-0/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dmaengine: virt-dma: Fix kernel-doc annotationsLars-Peter Clausen2015-10-271-9/+9
| | | | | | | | In kernel-doc annotations parameters need to start with a @ for them to be properly recognized. Add those where missing for virt-dma. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
* Revert "dmaengine: virt-dma: don't always free descriptor upon completion"Jun Nie2015-07-311-12/+1
| | | | | | | | | This reverts commit b9855f03d560d351e95301b9de0bc3cad3b31fe9. The patch break existing DMA usage case. For example, audio SOC dmaengine never release channel and cause virt-dma to cache too much memory in descriptor to exhaust system memory. Signed-off-by: Vinod Koul <vinod.koul@intel.com>
* dmaengine: virt-dma: don't always free descriptor upon completionRobert Jarzmik2015-06-171-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dma: fix vchan_cookie_complete() debug printJonas Jensen2014-01-261-1/+3
| | | | | | | | vd->tx.cookie is set zero on dma_cookie_complete(), save to local before printing it. Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
* dmaengine: virt-dma: add support for cyclic DMA periodic callbacksRussell King2012-07-011-0/+14
| | | | | | | | | | | | | Add support for cyclic DMA's periodic callbacks. Drivers are expected to call vchan_cyclic_callback() when a period has completed, which will schedule the tasklet to make the callback into the driver. As callbacks are made from tasklet context, it is important to realise that we don't guarantee a callback for each completed period, but for N completed periods where N may be greater than one. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* dmaengine: virt-dma: vchan_find_desc()Russell King2012-07-011-1/+1
| | | | | | | | Add a function to find a descriptor within the depths of the virtualized DMA channel support. Needed for tx_status functionality. Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* dmaengine: split out virtual channel DMA support from sa11x0 driverRussell King2012-07-011-0/+138
Split the virtual slave channel DMA support from the sa11x0 driver so this code can be shared with other slave DMA engine drivers. Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
OpenPOWER on IntegriCloud