diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 6ae487014d1cb42efd0822ec900fec66a602d65b..36ea341aa5d5e6412cef228e4031ccb9efaf52d5 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -432,7 +432,6 @@ static void qm_poll_qp(struct hisi_qp *qp, struct hisi_qm *qm) } else { if (QM_CQE_PHASE(cqe) == qp->qp_status.cqc_phase) { dma_rmb(); - qm_sq_head_update(qp); complete(&qp->completion); qm_cq_head_update(qp); cqe = qp->cqe + qp->qp_status.cq_head; diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index 40151b82956740528ba3aa4bb480f213f2892538..797b97f8e0c4923e569f44b0ff562ea276ec5741 100644 --- a/drivers/crypto/hisilicon/zip/zip_crypto.c +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c @@ -238,6 +238,14 @@ static void hisi_zip_copy_data_from_buffer(struct hisi_zip_qp_ctx *qp_ctx, struct hisi_zip_sqe *zip_sqe = hisi_zip_get_writeback_sqe(qp); memcpy(dst, buffer->output, zip_sqe->produced); + + if (qp->qp_status.sq_head == QM_Q_DEPTH - 1) + qp->qp_status.sq_head = 0; + else + qp->qp_status.sq_head++; + + if (unlikely(test_bit(QP_FULL, &qp->qp_status.flags))) + clear_bit(QP_FULL, &qp->qp_status.flags); } static int hisi_zip_compress_data_output(struct hisi_zip_qp_ctx *qp_ctx,