Skip to content

Commit 2c959a3

Browse files
Zhou Wangherbertx
authored andcommitted
crypto: hisilicon/zip - Use temporary sqe when doing work
Currently zip sqe is stored in hisi_zip_qp_ctx, which will bring corruption with multiple parallel users of the crypto tfm. This patch removes the zip_sqe in hisi_zip_qp_ctx and uses a temporary sqe instead. Signed-off-by: Zhou Wang <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Shukun Tan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent dbdc1ec commit 2c959a3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/crypto/hisilicon/zip/zip_crypto.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ struct hisi_zip_req_q {
6464

6565
struct hisi_zip_qp_ctx {
6666
struct hisi_qp *qp;
67-
struct hisi_zip_sqe zip_sqe;
6867
struct hisi_zip_req_q req_q;
6968
struct hisi_acc_sgl_pool *sgl_pool;
7069
struct hisi_zip *zip_dev;
@@ -484,11 +483,11 @@ static struct hisi_zip_req *hisi_zip_create_req(struct acomp_req *req,
484483
static int hisi_zip_do_work(struct hisi_zip_req *req,
485484
struct hisi_zip_qp_ctx *qp_ctx)
486485
{
487-
struct hisi_zip_sqe *zip_sqe = &qp_ctx->zip_sqe;
488486
struct acomp_req *a_req = req->req;
489487
struct hisi_qp *qp = qp_ctx->qp;
490488
struct device *dev = &qp->qm->pdev->dev;
491489
struct hisi_acc_sgl_pool *pool = qp_ctx->sgl_pool;
490+
struct hisi_zip_sqe zip_sqe;
492491
dma_addr_t input;
493492
dma_addr_t output;
494493
int ret;
@@ -511,13 +510,13 @@ static int hisi_zip_do_work(struct hisi_zip_req *req,
511510
}
512511
req->dma_dst = output;
513512

514-
hisi_zip_fill_sqe(zip_sqe, qp->req_type, input, output, a_req->slen,
513+
hisi_zip_fill_sqe(&zip_sqe, qp->req_type, input, output, a_req->slen,
515514
a_req->dlen, req->sskip, req->dskip);
516-
hisi_zip_config_buf_type(zip_sqe, HZIP_SGL);
517-
hisi_zip_config_tag(zip_sqe, req->req_id);
515+
hisi_zip_config_buf_type(&zip_sqe, HZIP_SGL);
516+
hisi_zip_config_tag(&zip_sqe, req->req_id);
518517

519518
/* send command to start a task */
520-
ret = hisi_qp_send(qp, zip_sqe);
519+
ret = hisi_qp_send(qp, &zip_sqe);
521520
if (ret < 0)
522521
goto err_unmap_output;
523522

0 commit comments

Comments
 (0)