]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - Using alloc_coherent for caam job rings
authorBharat Bhushan <Bharat.Bhushan@freescale.com>
Wed, 11 Jul 2012 03:06:10 +0000 (11:06 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Jul 2012 03:06:10 +0000 (11:06 +0800)
commit6733082237ea9294461fdb3220e96807c20be0a4
tree6c17ecaad399d4a5ce1a12f17020a72e17259dc1
parentc43a3fbb9f97e134e973e98b81e796db27292e67
crypto: caam - Using alloc_coherent for caam job rings

The caam job rings (input/output job ring) are allocated using
dma_map_single(). These job rings can be visualized as the ring
buffers in which the jobs are en-queued/de-queued. The s/w enqueues
the jobs in input job ring which h/w dequeues and after processing
it copies the jobs in output job ring. Software then de-queues the
job from output ring. Using dma_map/unmap_single() is not preferred
way to allocate memory for this type of requirements because this
adds un-necessary complexity.

Example, if bounce buffer (SWIOTLB) will get used then to make any
change visible in this memory to other processing unit requires
dmap_unmap_single() or dma_sync_single_for_cpu/device(). The
dma_unmap_single() can not be used as this will free the bounce
buffer, this will require changing the job rings on running system
and I seriously doubt that it will be not possible or very complex
to implement. Also using dma_sync_single_for_cpu/device() will also
add unnecessary complexity.

The simple and preferred way is using dma_alloc_coherent() for these
type of memory requirements.

This resolves the Linux boot crash issue when "swiotlb=force" is set
in bootargs on systems which have memory more than 4G.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/jr.c