aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeili Qian2021-05-15 18:44:37 +0800
committerHerbert Xu2021-05-23 08:52:41 +0800
commitdbbc5c06955cb9a56aed51170040a3967b79371d (patch)
treeb9a7d001fd7dba77d8697eb614bf067625602333
parentc858401cb4a884b840fa3214b8999e8feba3a59b (diff)
crypto: hisilicon/qm - initialize the device before doing tasks
The device needs to be initialized first, and then restart the queue to execute tasks after PF reset. Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/hisilicon/qm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index ce439a0c66c9..6a9c18f94876 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -4085,6 +4085,14 @@ void hisi_qm_reset_done(struct pci_dev *pdev)
struct hisi_qm *qm = pci_get_drvdata(pdev);
int ret;
+ if (qm->fun_type == QM_HW_PF) {
+ ret = qm_dev_hw_init(qm);
+ if (ret) {
+ pci_err(pdev, "Failed to init PF, ret = %d.\n", ret);
+ goto flr_done;
+ }
+ }
+
hisi_qm_dev_err_init(pf_qm);
ret = qm_restart(qm);
@@ -4094,12 +4102,6 @@ void hisi_qm_reset_done(struct pci_dev *pdev)
}
if (qm->fun_type == QM_HW_PF) {
- ret = qm_dev_hw_init(qm);
- if (ret) {
- pci_err(pdev, "Failed to init PF, ret = %d.\n", ret);
- goto flr_done;
- }
-
if (!qm->vfs_num)
goto flr_done;