aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/hisilicon
diff options
context:
space:
mode:
authorShukun Tan <tanshukun1@huawei.com>2020-08-15 17:56:14 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2020-08-21 14:47:52 +1000
commit8d8f8d494da7834708442070841bc91812fd3e00 (patch)
tree2f4c6e03f46852a89e1ba3bbf5513684022fe797 /drivers/crypto/hisilicon
parentcrypto: hisilicon/qm - fix no stop reason when use 'hisi_qm_stop' (diff)
downloadlinux-dev-8d8f8d494da7834708442070841bc91812fd3e00.tar.xz
linux-dev-8d8f8d494da7834708442070841bc91812fd3e00.zip
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 <tanshukun1@huawei.com> Signed-off-by: Yang Shen <shenyang39@huawei.com> Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon')
-rw-r--r--drivers/crypto/hisilicon/qm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 6d233b42c7e2..3c37e0099a4b 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;