FAILED: patch "[PATCH] PCI/ATS: Add pci_pri_supported() to check device or" failed to apply to 4.14-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3f9a7a13fe4cb6e119e4e4745fbf975d30bfac9b Mon Sep 17 00:00:00 2001
From: Ashok Raj <[email protected]>
Date: Thu, 23 Jul 2020 15:37:29 -0700
Subject: [PATCH] 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.
drivers/iommu/intel/iommu.c +1 -1
@@ -2554,7 +2554,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu, }if (info->ats_supported &&ecap_prs (iommu->ecap) && -pci_find_ext_capability (pdev,PCI_EXT_CAP_ID_PRI )) +pci_pri_supported (pdev)) info->pri_supported =1 ; } }
drivers/pci/ats.c +15 -0
@@ -325,6 +325,21 @@ int pci_prg_resp_pasid_required(struct pci_dev *pdev) return pdev->pasid_required; } + +/** +* pci_pri_supported - Check if PRI is supported. +* @pdev: PCI device structure +* +* Returns true if PRI capability is present, false otherwise. +*/ +bool pci_pri_supported (struct pci_dev *pdev) +{ +/* VFs share the PF PRI */ +if (pci_physfn (pdev)->pri_cap) +return true; +return false; +} +EXPORT_SYMBOL_GPL (pci_pri_supported);#endif /* CONFIG_PCI_PRI */ #ifdef CONFIG_PCI_PASID
include/linux/pci-ats.h +4 -0
@@ -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