summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAshok Raj <ashok.raj@intel.com>2020-07-24 01:37:29 +0300
committerBjorn Helgaas <bhelgaas@google.com>2020-07-24 17:50:41 +0300
commit3f9a7a13fe4cb6e119e4e4745fbf975d30bfac9b (patch)
tree35ee302aafcea3a116d369053c878bcbfbb4b09f /include
parent1c026a18d40bdd904d3ae1f7737cd08b376286d6 (diff)
downloadlinux-3f9a7a13fe4cb6e119e4e4745fbf975d30bfac9b.tar.xz
PCI/ATS: Add pci_pri_supported() to check device or associated PF
For SR-IOV, the PF PRI is shared between the PF and any associated VFs, and the PRI Capability is allowed for PFs but not for VFs. Searching for the PRI Capability on a VF always fails, even if its associated PF supports PRI. Add pci_pri_supported() to check whether device or its associated PF supports PRI. [bhelgaas: commit log, avoid "!!"] Fixes: b16d0cb9e2fc ("iommu/vt-d: Always enable PASID/PRI PCI capabilities before ATS") Link: https://lore.kernel.org/r/1595543849-19692-1-git-send-email-ashok.raj@intel.com Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Acked-by: Joerg Roedel <jroedel@suse.de> Cc: stable@vger.kernel.org # v4.4+
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci-ats.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index f75c307f346d..df54cd5b15db 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -28,6 +28,10 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
void pci_disable_pri(struct pci_dev *pdev);
int pci_reset_pri(struct pci_dev *pdev);
int pci_prg_resp_pasid_required(struct pci_dev *pdev);
+bool pci_pri_supported(struct pci_dev *pdev);
+#else
+static inline bool pci_pri_supported(struct pci_dev *pdev)
+{ return false; }
#endif /* CONFIG_PCI_PRI */
#ifdef CONFIG_PCI_PASID