diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index 808e54e26a7f86a1f1fc36c047fa48bef6ec3fd0..57f42ffd08e57a70562d0a5f3aabd59803795880 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 8128b809cd23e5de0c813de95ff65d4bcb7f6e79..e319de49ea8029db808ebaeda19f6d6ec6762352 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");