]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: atmel-sha - correct the way data are split
authorLudovic Desroches <ludovic.desroches@atmel.com>
Tue, 7 Apr 2015 09:45:04 +0000 (17:45 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 8 Apr 2015 14:20:01 +0000 (22:20 +0800)
commitecc5536c092103c34e0dfa1518a3480761ed0d90
tree46e151929ee8314d8d1f718550f280c2f7d08075
parent54c8851a85bb1d3a0ac93f11bf822e8b106115a7
crypto: atmel-sha - correct the way data are split

When a hash is requested on data bigger than the buffer allocated by the
SHA driver, the way DMA transfers are performed is quite strange:
The buffer is filled at each update request. When full, a DMA transfer
is done. On next update request, another DMA transfer is done. Then we
wait to have a full buffer (or the end of the data) to perform the dma
transfer. Such a situation lead sometimes, on SAMA5D4, to a case where
dma transfer is finished but the data ready irq never comes. Moreover
hash was incorrect in this case.

With this patch, dma transfers are only performed when the buffer is
full or when there is no more data. So it removes the transfer whose size
is equal the update size after the full buffer transmission.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-sha.c