aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/async_tx/async_memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/async_tx/async_memcpy.c')
-rw-r--r--crypto/async_tx/async_memcpy.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c
index e8c8956ef1dd..faca0bc52068 100644
--- a/crypto/async_tx/async_memcpy.c
+++ b/crypto/async_tx/async_memcpy.c
@@ -48,26 +48,25 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
48{ 48{
49 struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMCPY); 49 struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMCPY);
50 struct dma_device *device = chan ? chan->device : NULL; 50 struct dma_device *device = chan ? chan->device : NULL;
51 int int_en = cb_fn ? 1 : 0; 51 struct dma_async_tx_descriptor *tx = NULL;
52 struct dma_async_tx_descriptor *tx = device ?
53 device->device_prep_dma_memcpy(chan, len,
54 int_en) : NULL;
55 52
56 if (tx) { /* run the memcpy asynchronously */ 53 if (device) {
57 dma_addr_t addr; 54 dma_addr_t dma_dest, dma_src;
58 55
59 pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len); 56 dma_dest = dma_map_page(device->dev, dest, dest_offset, len,
57 DMA_FROM_DEVICE);
60 58
61 addr = dma_map_page(device->dev, dest, dest_offset, len, 59 dma_src = dma_map_page(device->dev, src, src_offset, len,
62 DMA_FROM_DEVICE); 60 DMA_TO_DEVICE);
63 tx->tx_set_dest(addr, tx, 0);
64 61
65 addr = dma_map_page(device->dev, src, src_offset, len, 62 tx = device->device_prep_dma_memcpy(chan, dma_dest, dma_src,
66 DMA_TO_DEVICE); 63 len, cb_fn != NULL);
67 tx->tx_set_src(addr, tx, 0); 64 }
68 65
66 if (tx) {
67 pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
69 async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param); 68 async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param);
70 } else { /* run the memcpy synchronously */ 69 } else {
71 void *dest_buf, *src_buf; 70 void *dest_buf, *src_buf;
72 pr_debug("%s: (sync) len: %zu\n", __FUNCTION__, len); 71 pr_debug("%s: (sync) len: %zu\n", __FUNCTION__, len);
73 72