Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
From: Yang Shen <shenyang39@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <linux-crypto@vger.kernel.org>, <xuzaibo@huawei.com>,
	<wangzhou1@hisilicon.com>
Subject: [Patch v2 7/9] crypto: hisilicon/qm - fix VF not available after PF FLR
Date: Wed, 1 Jul 2020 15:19:53 +0800
Message-ID: <1593587995-7391-8-git-send-email-shenyang39@huawei.com> (raw)
In-Reply-To: <1593587995-7391-1-git-send-email-shenyang39@huawei.com>

From: Shukun Tan <tanshukun1@huawei.com>

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>
---
 drivers/crypto/hisilicon/qm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index db816be..a441b3d 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -3334,6 +3334,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;
@@ -3497,6 +3500,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;
-- 
2.7.4


  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  7:19 [Patch v2 0/9] crypto: hisilicon/qm - misc fixes Yang Shen
2020-07-01  7:19 ` [Patch v2 1/9] crypto: hisilicon/qm - fix wrong release after using strsep Yang Shen
2020-07-01  7:19 ` [Patch v2 2/9] crypto: hisilicon/qm - clear used reference count when start qp Yang Shen
2020-07-01  7:19 ` [Patch v2 3/9] crypto: hisilicon/qm - fix print frequence in hisi_qp_send Yang Shen
2020-07-01  7:19 ` [Patch v2 4/9] crypto: hisilicon/qm - fix judgement of queue is full Yang Shen
2020-07-01  7:19 ` [Patch v2 5/9] crypto: hisilicon/qm - fix event queue depth to 2048 Yang Shen
2020-07-01  7:19 ` [Patch v2 6/9] crypto: hisilicon/qm - fix no stop reason when use hisi_qm_stop Yang Shen
2020-07-01  7:19 ` Yang Shen [this message]
2020-07-01  7:19 ` [Patch v2 8/9] crypto: hisilicon/qm - fix the process of register algorithms to crypto Yang Shen
2020-07-01  7:19 ` [Patch v2 9/9] crypto: hisilicon/qm - register callback function to 'pci_driver.shutdown' Yang Shen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1593587995-7391-8-git-send-email-shenyang39@huawei.com \
    --to=shenyang39@huawei.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git