async_xor: dma_map destination DMA_BIDIRECTIONAL
authorDan Williams <dan.j.williams@intel.com>
Mon, 8 Dec 2008 20:46:00 +0000 (13:46 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 14 Jan 2009 17:44:03 +0000 (09:44 -0800)
commitcf7af4a82fe408a8c9628480ac3dc272e087ce75
tree2bbcd39200e386232a266e39b0d9bda5d40bd674
parent65e8fedf5e9d81cce3505a4dfce77096eac89711
async_xor: dma_map destination DMA_BIDIRECTIONAL

commit a06d568f7c5e40e34ea64881842deb8f4382babf upstream.

Mapping the destination multiple times is a misuse of the dma-api.
Since the destination may be reused as a source, ensure that it is only
mapped once and that it is mapped bidirectionally.  This appears to add
ugliness on the unmap side in that it always reads back the destination
address from the descriptor, but gcc can determine that dma_unmap is a
nop and not emit the code that calculates its arguments.

Cc: Saeed Bishara <saeed@marvell.com>
Acked-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
crypto/async_tx/async_xor.c
drivers/dma/iop-adma.c
drivers/dma/mv_xor.c