From f020f1209baf0998f178955eee18bf7f99dac3d4 Mon Sep 17 00:00:00 2001 From: yekai13 Date: Tue, 24 Sep 2019 18:48:51 +0800 Subject: [PATCH] hpre:fix the call trace wrong when unbind the hpre device. driver inclusion category: bugfix bugzilla: NA CVE: NA Fix the call trace wrong when unbind the hpre device. Feature or Bugfix:Bugfix Signed-off-by: yekai (A) Reviewed-by: xuzaibo Reviewed-by: Zhou Wang Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/hpre/hpre.h | 1 + drivers/crypto/hisilicon/hpre/hpre_main.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/crypto/hisilicon/hpre/hpre.h b/drivers/crypto/hisilicon/hpre/hpre.h index b424719c59b7..b61e0be80bdb 100644 --- a/drivers/crypto/hisilicon/hpre/hpre.h +++ b/drivers/crypto/hisilicon/hpre/hpre.h @@ -13,6 +13,7 @@ #define HPRE_PF_DEF_Q_NUM 64 #define HPRE_PF_DEF_Q_BASE 0 #define HPRE_RESET 0 +#define HPRE_WAIT_DELAY 1000 struct hpre_ctrl; diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 5e0b1b6c9224..95b8140f449c 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -1054,12 +1054,21 @@ static int hpre_sriov_configure(struct pci_dev *pdev, int num_vfs) } #endif +static void hpre_remove_wait_delay(struct hpre *hpre) +{ + while (hisi_qm_frozen(&hpre->qm)) + ; + udelay(HPRE_WAIT_DELAY); +} + static void hpre_remove(struct pci_dev *pdev) { struct hpre *hpre = pci_get_drvdata(pdev); struct hisi_qm *qm = &hpre->qm; int ret; + if (uacce_mode != UACCE_MODE_NOUACCE) + hpre_remove_wait_delay(hpre); hpre_algs_unregister(); hpre_remove_from_list(hpre); -- GitLab