• Leilei Zhao's avatar
    crypto: atmel-aes - sync the buf used in DMA or CPU · 289b2623
    Leilei Zhao authored
    The input buffer and output buffer are mapped for DMA transfer
    in Atmel AES driver. But they are also be used by CPU when
    the requested crypt length is not bigger than the threshold
    value 16. The buffers will be cached in cache line when CPU
    accessed them. When DMA uses the buffers again, the memory
    can happened to be flushed by cache while DMA starts transfer.
    So using API dma_sync_single_for_device and dma_sync_single_for_cpu
    in DMA to ensure DMA coherence and CPU always access the correct
    value. This fix the issue that the encrypted result periodically goes
    wrong when doing performance test with OpenSSH.
    Signed-off-by: default avatarLeilei Zhao <leilei.zhao@atmel.com>
    Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
atmel-aes.c 35.4 KB