crypto: omap-aes - Simplify DMA usage by using direct SGs
authorJoel Fernandes <joelf@ti.com>
Sun, 18 Aug 2013 02:42:25 +0000 (21:42 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 21 Aug 2013 11:27:59 +0000 (21:27 +1000)
commit4b645c9465065bb3f8fb717789e864aa6d675052
tree62a63610c66fd8856fc8e134b8c0eacb2dc67cc0
parente77c756eca76077032db23d8d4b85dcd743742b4
crypto: omap-aes - Simplify DMA usage by using direct SGs

In early version of this driver, assumptions were made such as DMA layer
requires contiguous buffers etc. Due to this, new buffers were allocated,
mapped and used for DMA. These assumptions are no longer true and DMAEngine
scatter-gather DMA doesn't have such requirements. We simply the DMA operations
by directly using the scatter-gather buffers provided by the crypto layer
instead of creating our own.

Lot of logic that handled DMA'ing only X number of bytes of the total, or as
much as fitted into a 3rd party buffer is removed and is no longer required.

Also, good performance improvement of atleast ~20% seen with encrypting a
buffer size of 8K (1800 ops/sec vs 1400 ops/sec).  Improvement will be higher
for much larger blocks though such benchmarking is left as an exercise for the
reader.  Also DMA usage is much more simplified and coherent with rest of the
code.

Signed-off-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-aes.c