Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8efbc2c0 authored by Russell King's avatar Russell King Committed by Herbert Xu
Browse files

crypto: marvell/cesa - fix first-fragment handling in mv_cesa_ahash_dma_last_req()



When adding the software padding, this must be done using the first/mid
fragment mode, and any subsequent operation needs to be a mid-fragment.
Fix this.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ab270e70
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -575,20 +575,12 @@ mv_cesa_ahash_dma_last_req(struct mv_cesa_tdma_chain *chain,
		if (IS_ERR(op))
			return op;

		mv_cesa_update_op_cfg(op, CESA_SA_DESC_CFG_MID_FRAG,
				      CESA_SA_DESC_CFG_FRAG_MSK);

		if (len == trailerlen)
			return op;

		padoff += len;
	}

	if (!mv_cesa_mac_op_is_first_frag(&creq->op_tmpl))
		mv_cesa_update_op_cfg(&creq->op_tmpl,
				      CESA_SA_DESC_CFG_MID_FRAG,
				      CESA_SA_DESC_CFG_FRAG_MSK);

	ret = mv_cesa_dma_add_data_transfer(chain,
					    CESA_SA_DATA_SRAM_OFFSET,
					    ahashdreq->padding_dma +