Skip to content

Commit

Permalink
crypto: hisilicon/qm - initialize the device before doing tasks
Browse files Browse the repository at this point in the history
The device needs to be initialized first, and then restart the queue to
execute tasks after PF reset.

Signed-off-by: Weili Qian <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Weili Qian authored and herbertx committed May 23, 2021
1 parent c858401 commit dbbc5c0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/crypto/hisilicon/qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit dbbc5c0

Please sign in to comment.