From 14d0b02793dec72fd7181874db85efdc8d592dd9 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sun, 29 Sep 2019 14:42:48 +0800 Subject: [PATCH] sec2: fixup compile warnings and add hw_isolate driver inclusion category: bugfix bugzilla: NA CVE: NA Feature or Bugfix:Bugfix Signed-off-by: Zhangwei Reviewed-by: lingmingqiang Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 8 ++++++-- drivers/crypto/hisilicon/sec2/sec_main.c | 14 ++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index 808e54e26a7f..57f42ffd08e5 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -410,13 +410,17 @@ static int hisi_sec_create_qp_ctx(struct hisi_qm *qm, struct hisi_sec_ctx *ctx, qp_ctx->c_in_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH, FUSION_LIMIT_MAX); - if (IS_ERR(qp_ctx->c_in_pool)) + if (IS_ERR(qp_ctx->c_in_pool)) { + ret = PTR_ERR(qp_ctx->c_in_pool); goto err_free_sqe_list; + } qp_ctx->c_out_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH, FUSION_LIMIT_MAX); - if (IS_ERR(qp_ctx->c_out_pool)) + if (IS_ERR(qp_ctx->c_out_pool)) { + ret = PTR_ERR(qp_ctx->c_out_pool); goto err_free_c_in_pool; + } ret = ctx->req_op->queue_alloc(ctx, qp_ctx); if (ret) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index 8128b809cd23..e319de49ea80 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -1304,6 +1304,16 @@ static int hisi_sec_controller_reset_prepare(struct hisi_sec *hisi_sec) return ret; } +#ifdef CONFIG_CRYPTO_QM_UACCE + if (qm->use_uacce) { + ret = uacce_hw_err_isolate(&qm->uacce); + if (ret) { + dev_err(&pdev->dev, "Fails to isolate hw err!\n"); + return ret; + } + } +#endif + return 0; } @@ -1378,7 +1388,6 @@ static int hisi_sec_vf_reset_done(struct pci_dev *pdev) if (pci_physfn(dev) == pdev) { qm = &hisi_sec->qm; - hisi_qm_clear_queues(qm); ret = hisi_qm_restart(qm); if (ret) goto reset_fail; @@ -1396,8 +1405,6 @@ static int hisi_sec_controller_reset_done(struct hisi_sec *hisi_sec) struct pci_dev *pdev = qm->pdev; int ret; - hisi_qm_clear_queues(qm); - hisi_sec_set_user_domain_and_cache(hisi_sec); hisi_sec_hw_error_init(hisi_sec); @@ -1535,7 +1542,6 @@ static void hisi_sec_reset_done(struct pci_dev *pdev) struct device *dev = &pdev->dev; int ret; - hisi_qm_clear_queues(qm); ret = hisi_qm_restart(qm); if (ret) { dev_err(dev, "Failed to start QM!\n"); -- GitLab