aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorLeilei Zhao <leilei.zhao@atmel.com>2015-04-07 05:45:07 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2015-04-08 10:20:03 -0400
commit3f1992c002064f5628eafbec9649f7a82f439eaf (patch)
treeb977f4bee63a77b6dfe7e17e764cb4039d760c42 /drivers/crypto
parent62728e82026c90af004dd2c328c1314f2f3e6b58 (diff)
crypto: atmel-sha - correct the max burst size
The maximum source and destination burst size is 16 according to the datasheet of Atmel DMA. And the value is also checked in function at_xdmac_csize of Atmel DMA driver. With the restrict, the value beyond maximum value will not be processed in DMA driver, so SHA384 and SHA512 will not work and the program will wait forever. So here change the max burst size of all the cases to 16 in order to make SHA384 and SHA512 work and keep consistent with DMA driver and datasheet. 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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/atmel-sha.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 08dfddfcffbb..5b35433c5399 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -432,14 +432,8 @@ static int atmel_sha_xmit_dma(struct atmel_sha_dev *dd, dma_addr_t dma_addr1,
432 dev_dbg(dd->dev, "xmit_dma: digcnt: 0x%llx 0x%llx, length: %d, final: %d\n", 432 dev_dbg(dd->dev, "xmit_dma: digcnt: 0x%llx 0x%llx, length: %d, final: %d\n",
433 ctx->digcnt[1], ctx->digcnt[0], length1, final); 433 ctx->digcnt[1], ctx->digcnt[0], length1, final);
434 434
435 if (ctx->flags & (SHA_FLAGS_SHA1 | SHA_FLAGS_SHA224 | 435 dd->dma_lch_in.dma_conf.src_maxburst = 16;
436 SHA_FLAGS_SHA256)) { 436 dd->dma_lch_in.dma_conf.dst_maxburst = 16;
437 dd->dma_lch_in.dma_conf.src_maxburst = 16;
438 dd->dma_lch_in.dma_conf.dst_maxburst = 16;
439 } else {
440 dd->dma_lch_in.dma_conf.src_maxburst = 32;
441 dd->dma_lch_in.dma_conf.dst_maxburst = 32;
442 }
443 437
444 dmaengine_slave_config(dd->dma_lch_in.chan, &dd->dma_lch_in.dma_conf); 438 dmaengine_slave_config(dd->dma_lch_in.chan, &dd->dma_lch_in.dma_conf);
445 439