From: Omer Khaliq <okhaliq@caviumnetworks.com>
To: <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
<linux-crypto@vger.kernel.org>,
<linux-arm-kernel@vger.kernel.org>, <bhelgaas@google.com>,
<mpm@selenic.com>, <herbert@gondor.apana.org.au>,
<Ananth.Jasty@cavium.com>, <david.daney@cavium.com>
Cc: Omer Khaliq <okhaliq@caviumnetworks.com>
Subject: [PATCH 1/2] PCI/IOV: Add function to allow Function Dependency Link override.
Date: Fri, 19 Aug 2016 15:32:12 -0700 [thread overview]
Message-ID: <1471645933-3643-2-git-send-email-okhaliq@caviumnetworks.com> (raw)
In-Reply-To: <1471645933-3643-1-git-send-email-okhaliq@caviumnetworks.com>
From: David Daney <david.daney@cavium.com>
Some hardware presents an incorrect SR-IOV Function Dependency Link,
add a function to allow this to be overridden in the PF driver for
such devices.
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Omer Khaliq <okhaliq@caviumnetworks.com>
---
drivers/pci/iov.c | 14 ++++++++++++++
include/linux/pci.h | 1 +
2 files changed, 15 insertions(+)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 2194b44..81f0672 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -640,6 +640,20 @@ int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
EXPORT_SYMBOL_GPL(pci_enable_sriov);
/**
+ * pci_sriov_fdl_override - fix incorrect Function Dependency Link
+ * @dev: the PCI device
+ * @fdl: the corrected Function Dependency Link value
+ *
+ * For hardware presenting an incorrect Function Dependency Link in
+ * the SR-IOV Extended Capability, allow a driver to override it.
+ */
+void pci_sriov_fdl_override(struct pci_dev *dev, u8 fdl)
+{
+ dev->sriov->link = fdl;
+}
+EXPORT_SYMBOL_GPL(pci_sriov_fdl_override);
+
+/**
* pci_disable_sriov - disable the SR-IOV capability
* @dev: the PCI device
*/
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2599a98..da8a5b3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1823,6 +1823,7 @@ int pci_num_vf(struct pci_dev *dev);
int pci_vfs_assigned(struct pci_dev *dev);
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
int pci_sriov_get_totalvfs(struct pci_dev *dev);
+void pci_sriov_fdl_override(struct pci_dev *dev, u8 fdl);
resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno);
#else
static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id)
--
1.9.1
next prev parent reply other threads:[~2016-08-20 1:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 22:32 [PATCH 0/2] hwrng/PCI/IOV: Add driver for Cavium Thunder RNG Omer Khaliq
2016-08-19 22:32 ` Omer Khaliq [this message]
2016-08-22 14:36 ` [PATCH 1/2] PCI/IOV: Add function to allow Function Dependency Link override Bjorn Helgaas
2016-08-22 14:49 ` David Daney
2016-08-22 16:14 ` Bjorn Helgaas
2016-08-19 22:32 ` [PATCH 2/2] hwrng: thunderx: Add Cavium HWRNG driver for ThunderX SoC Omer Khaliq
2016-08-20 5:41 ` Corentin LABBE
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=1471645933-3643-2-git-send-email-okhaliq@caviumnetworks.com \
--to=okhaliq@caviumnetworks.com \
--cc=Ananth.Jasty@cavium.com \
--cc=bhelgaas@google.com \
--cc=david.daney@cavium.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mpm@selenic.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®