summaryrefslogtreecommitdiffstats
path: root/crypto/async_tx/async_memcpy.c
diff options
context:
space:
mode:
authorDan Williams2009-09-09 02:42:50 +0200
committerDan Williams2009-09-09 02:42:50 +0200
commit0403e3827788d878163f9ef0541b748b0f88ca5d (patch)
tree2dc73744bd92c268a1310f24668167f130877278 /crypto/async_tx/async_memcpy.c
parentMerge branch 'md-raid6-accel' into ioat3.2 (diff)
downloadkernel-qcow2-linux-0403e3827788d878163f9ef0541b748b0f88ca5d.tar.gz
kernel-qcow2-linux-0403e3827788d878163f9ef0541b748b0f88ca5d.tar.xz
kernel-qcow2-linux-0403e3827788d878163f9ef0541b748b0f88ca5d.zip
dmaengine: add fence support
Some engines optimize operation by reading ahead in the descriptor chain such that descriptor2 may start execution before descriptor1 completes. If descriptor2 depends on the result from descriptor1 then a fence is required (on descriptor2) to disable this optimization. The async_tx api could implicitly identify dependencies via the 'depend_tx' parameter, but that would constrain cases where the dependency chain only specifies a completion order rather than a data dependency. So, provide an ASYNC_TX_FENCE to explicitly identify data dependencies. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'crypto/async_tx/async_memcpy.c')
-rw-r--r--crypto/async_tx/async_memcpy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c
index 98e15bd0dcb5..b38cbb3fd527 100644
--- a/crypto/async_tx/async_memcpy.c
+++ b/crypto/async_tx/async_memcpy.c
@@ -52,9 +52,12 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
if (device) {
dma_addr_t dma_dest, dma_src;
- unsigned long dma_prep_flags;
+ unsigned long dma_prep_flags = 0;
- dma_prep_flags = submit->cb_fn ? DMA_PREP_INTERRUPT : 0;
+ if (submit->cb_fn)
+ dma_prep_flags |= DMA_PREP_INTERRUPT;
+ if (submit->flags & ASYNC_TX_FENCE)
+ dma_prep_flags |= DMA_PREP_FENCE;
dma_dest = dma_map_page(device->dev, dest, dest_offset, len,
DMA_FROM_DEVICE);