diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 2865dd6ad59b4822e6e1fbf6102b67fb9f4ccf93..d09176bc606dec70f4f16811a31e2f7b772ca409 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -1465,13 +1465,17 @@ static int hisi_qm_uacce_get_queue(struct uacce *uacce, unsigned long arg, static void hisi_qm_uacce_put_queue(struct uacce_queue *q) { + struct hisi_qm *qm = q->uacce->priv; struct hisi_qp *qp = q->priv; - /* - * As put_queue is only called in uacce_mode=1, and only one queue can - * be used in this mode. we flush all sqc cache back in put queue. - */ - hisi_qm_cache_wb(qp->qm); + if (!qm->use_dma_api) { + /* + * As put_queue is only called in uacce_mode=1, and only one + * queue can be used in this mode. we flush all sqc cache back + * in put queue. + */ + hisi_qm_cache_wb(qp->qm); + } /* need to stop hardware, but can not support in v1 */ hisi_qm_release_qp(qp);