From 34c8a762ab67f84433e164b29749fde19757556e Mon Sep 17 00:00:00 2001 From: lingmingqiang Date: Thu, 11 Jul 2019 14:41:27 +0800 Subject: [PATCH] ACC: Bugfix on "QM wirteback sqc cache fail" driver inclusion category: bugfix bugzilla: NA CVE: NA Bugfix on "QM wirteback sqc cache fail" Changes to be committed: modified: drivers/crypto/hisilicon/qm.c Reviewed-by: hucheng.hu Signed-off-by: lingmingqiang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/qm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 2865dd6ad59b..d09176bc606d 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); -- GitLab