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+
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -28,6 +28,10 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs); · 27 unmodified lines | |||
| 28 | void pci_disable_pri(struct pci_dev *pdev); | 28 | void pci_disable_pri(struct pci_dev *pdev); |
| 29 | int pci_reset_pri(struct pci_dev *pdev); | 29 | int pci_reset_pri(struct pci_dev *pdev); |
| 30 | int pci_prg_resp_pasid_required(struct pci_dev *pdev); | 30 | int pci_prg_resp_pasid_required(struct pci_dev *pdev); |
| 31 | bool pci_pri_supported(struct pci_dev *pdev); | ||
| 32 | #else | ||
| 33 | static inline bool pci_pri_supported(struct pci_dev *pdev) | ||
| 34 | { return false; } | ||
| 31 | #endif /* CONFIG_PCI_PRI */ | 35 | #endif /* CONFIG_PCI_PRI */ |
| 32 | 36 | ||
| 33 | #ifdef CONFIG_PCI_PASID | 37 | #ifdef CONFIG_PCI_PASID |