• L
    crypto: atmel-aes - sync the buf used in DMA or CPU · 289b2623
    Leilei Zhao 提交于
    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: NLeilei Zhao <leilei.zhao@atmel.com>
    Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
    Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
    289b2623
atmel-aes.c 35.4 KB