From: Dongdong Liu <liudongdong3@huawei.com>
To: <helgaas@kernel.org>, <linux-pci@vger.kernel.org>
Subject: [RFC PATCH 3/3] PCI/IOV: Enable 10-bit tags support for PCIe VF devices
Date: Sat, 9 Jan 2021 17:11:23 +0800 [thread overview]
Message-ID: <1610183483-2061-4-git-send-email-liudongdong3@huawei.com> (raw)
In-Reply-To: <1610183483-2061-1-git-send-email-liudongdong3@huawei.com>
Enable VF 10-Bit Tag Requester when it's upstream component support
10-bit Tag Completer.
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
drivers/pci/iov.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 4afd4ee..9bff76b 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -537,6 +537,10 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
pci_iov_set_numvfs(dev, nr_virtfn);
iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
+ if ((iov->cap & PCI_SRIOV_CAP_VF_10BIT_TAG_REQ) &&
+ dev->ext_10bit_tag_comp_path)
+ iov->ctrl |= PCI_SRIOV_CTRL_VF_10BIT_TAG_REQ_EN;
+
pci_cfg_access_lock(dev);
pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
msleep(100);
@@ -553,6 +557,8 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
err_pcibios:
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
+ if (iov->ctrl & PCI_SRIOV_CTRL_VF_10BIT_TAG_REQ_EN)
+ iov->ctrl &= ~PCI_SRIOV_CTRL_VF_10BIT_TAG_REQ_EN;
pci_cfg_access_lock(dev);
pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
ssleep(1);
@@ -585,6 +591,8 @@ static void sriov_disable(struct pci_dev *dev)
sriov_del_vfs(dev);
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
+ if (iov->ctrl & PCI_SRIOV_CTRL_VF_10BIT_TAG_REQ_EN)
+ iov->ctrl &= ~PCI_SRIOV_CTRL_VF_10BIT_TAG_REQ_EN;
pci_cfg_access_lock(dev);
pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
ssleep(1);
--
1.9.1
next prev parent reply other threads:[~2021-01-09 9:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 9:11 [RFC PATCH 0/3] PCI: Enable 10-bit tags support for PCIe devices Dongdong Liu
2021-01-09 9:11 ` [RFC PATCH 1/3] PCI: Add 10-Bit Tag register definitions Dongdong Liu
2021-01-09 9:11 ` [RFC PATCH 2/3] PCI: Enable 10-bit tags support for PCIe devices Dongdong Liu
2021-01-09 9:11 ` Dongdong Liu [this message]
2021-02-09 13:18 ` [RFC PATCH 0/3] " Dongdong Liu
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=1610183483-2061-4-git-send-email-liudongdong3@huawei.com \
--to=liudongdong3@huawei.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.