diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-10-18 12:24:11 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-10-20 10:11:05 -0400 |
commit | 2f396a91d1d01a423fd87b7c6ff71600d06b9c05 (patch) | |
tree | ee3915fee57f74aeaad52156cec6eeacd0246e82 | |
parent | 9621288673cb2a1805eadf29b92e5bcec6a0e2e5 (diff) |
crypto: marvell/cesa - always ensure mid-fragments after first-fragment
If we add a template first-fragment operation, always update the
template to be a mid-fragment. This ensures that mid-fragments
always follow on from a first fragment in every case.
This means we can move the first to mid-fragment update code out of
mv_cesa_ahash_dma_add_data().
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/marvell/hash.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index e7991cb35582..3811ec0dd694 100644 --- a/drivers/crypto/marvell/hash.c +++ b/drivers/crypto/marvell/hash.c | |||
@@ -491,6 +491,11 @@ mv_cesa_dma_add_frag(struct mv_cesa_tdma_chain *chain, | |||
491 | if (ret) | 491 | if (ret) |
492 | return ERR_PTR(ret); | 492 | return ERR_PTR(ret); |
493 | 493 | ||
494 | if (mv_cesa_mac_op_is_first_frag(tmpl)) | ||
495 | mv_cesa_update_op_cfg(tmpl, | ||
496 | CESA_SA_DESC_CFG_MID_FRAG, | ||
497 | CESA_SA_DESC_CFG_FRAG_MSK); | ||
498 | |||
494 | return op; | 499 | return op; |
495 | } | 500 | } |
496 | 501 | ||
@@ -529,7 +534,6 @@ mv_cesa_ahash_dma_add_data(struct mv_cesa_tdma_chain *chain, | |||
529 | struct mv_cesa_ahash_req *creq, | 534 | struct mv_cesa_ahash_req *creq, |
530 | gfp_t flags) | 535 | gfp_t flags) |
531 | { | 536 | { |
532 | struct mv_cesa_op_ctx *op; | ||
533 | int ret; | 537 | int ret; |
534 | 538 | ||
535 | /* Add input transfers */ | 539 | /* Add input transfers */ |
@@ -538,17 +542,8 @@ mv_cesa_ahash_dma_add_data(struct mv_cesa_tdma_chain *chain, | |||
538 | if (ret) | 542 | if (ret) |
539 | return ERR_PTR(ret); | 543 | return ERR_PTR(ret); |
540 | 544 | ||
541 | op = mv_cesa_dma_add_frag(chain, &creq->op_tmpl, dma_iter->base.op_len, | 545 | return mv_cesa_dma_add_frag(chain, &creq->op_tmpl, dma_iter->base.op_len, |
542 | flags); | 546 | flags); |
543 | if (IS_ERR(op)) | ||
544 | return op; | ||
545 | |||
546 | if (mv_cesa_mac_op_is_first_frag(&creq->op_tmpl)) | ||
547 | mv_cesa_update_op_cfg(&creq->op_tmpl, | ||
548 | CESA_SA_DESC_CFG_MID_FRAG, | ||
549 | CESA_SA_DESC_CFG_FRAG_MSK); | ||
550 | |||
551 | return op; | ||
552 | } | 547 | } |
553 | 548 | ||
554 | static struct mv_cesa_op_ctx * | 549 | static struct mv_cesa_op_ctx * |