From: Shukun Tan Date: Sat, 15 Aug 2020 09:56:14 +0000 (+0800) Subject: crypto: hisilicon/qm - fix VF not available after PF FLR X-Git-Tag: v5.10.7~1291^2~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d8f8d494da7834708442070841bc91812fd3e00;p=platform%2Fkernel%2Flinux-rpi.git crypto: hisilicon/qm - fix VF not available after PF FLR When PF FLR, the hardware will actively trigger the VF FLR. Configuration space of VF needs to be saved and restored to ensure that it is available after the PF FLR. Fixes: 7ce396fa12a9("crypto: hisilicon - add FLR support") Signed-off-by: Shukun Tan Signed-off-by: Yang Shen Reviewed-by: Zhou Wang Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 6d233b4..3c37e00 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -3318,6 +3318,9 @@ static int qm_vf_reset_prepare(struct hisi_qm *qm, continue; if (pci_physfn(virtfn) == pdev) { + /* save VFs PCIE BAR configuration */ + pci_save_state(virtfn); + ret = hisi_qm_stop(vf_qm, stop_reason); if (ret) goto stop_fail; @@ -3481,6 +3484,9 @@ static int qm_vf_reset_done(struct hisi_qm *qm) continue; if (pci_physfn(virtfn) == pdev) { + /* enable VFs PCIE BAR configuration */ + pci_restore_state(virtfn); + ret = qm_restart(vf_qm); if (ret) goto restart_fail;