summaryrefslogtreecommitdiffstats
path: root/drivers/dma/mv_xor.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-24 21:08:26 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-24 21:08:26 +0100
commitdb8862eafe8a5d030a3b02e81b8bb47447c315e3 (patch)
tree073ea7b46809bf804134cbf008a593413c02a99c /drivers/dma/mv_xor.c
parentc5dee6177f4bd2095aab7d9be9f6ebdddd6deee9 (diff)
parentc20137fc5329eaf24093fc48c52608dc66be8e5c (diff)
downloadop-kernel-dev-db8862eafe8a5d030a3b02e81b8bb47447c315e3.zip
op-kernel-dev-db8862eafe8a5d030a3b02e81b8bb47447c315e3.tar.gz
Merge branch 'linus' into tracing/hw-branch-tracing
Diffstat (limited to 'drivers/dma/mv_xor.c')
-rw-r--r--drivers/dma/mv_xor.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 0328da0..bcda174 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -311,17 +311,26 @@ mv_xor_run_tx_complete_actions(struct mv_xor_desc_slot *desc,
enum dma_ctrl_flags flags = desc->async_tx.flags;
u32 src_cnt;
dma_addr_t addr;
+ dma_addr_t dest;
+ src_cnt = unmap->unmap_src_cnt;
+ dest = mv_desc_get_dest_addr(unmap);
if (!(flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
- addr = mv_desc_get_dest_addr(unmap);
- dma_unmap_page(dev, addr, len, DMA_FROM_DEVICE);
+ enum dma_data_direction dir;
+
+ if (src_cnt > 1) /* is xor ? */
+ dir = DMA_BIDIRECTIONAL;
+ else
+ dir = DMA_FROM_DEVICE;
+ dma_unmap_page(dev, dest, len, dir);
}
if (!(flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
- src_cnt = unmap->unmap_src_cnt;
while (src_cnt--) {
addr = mv_desc_get_src_addr(unmap,
src_cnt);
+ if (addr == dest)
+ continue;
dma_unmap_page(dev, addr, len,
DMA_TO_DEVICE);
}
OpenPOWER on IntegriCloud