summaryrefslogtreecommitdiffstats
path: root/drivers/pci/ats.c
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2018-06-30 11:24:24 -0400
committerBjorn Helgaas <bhelgaas@google.com>2018-06-30 14:10:03 -0500
commit7ce3f912ae0a79e5d738a3ae1f158b281973e849 (patch)
tree69c2b3d22573fa0a3567e4c3e093fc1fb70d7965 /drivers/pci/ats.c
parentce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff)
downloadlinux-7ce3f912ae0a79e5d738a3ae1f158b281973e849.tar.gz
linux-7ce3f912ae0a79e5d738a3ae1f158b281973e849.tar.bz2
linux-7ce3f912ae0a79e5d738a3ae1f158b281973e849.zip
PCI: Enable PASID only if entire path supports End-End TLP prefixes
A PCIe endpoint carries the process address space identifier (PASID) in the TLP prefix as part of the memory read/write transaction. The address information in the TLP is relevant only for a given PASID context. An IOMMU takes PASID value and the address information from the TLP to look up the physical address in the system. PASID is an End-End TLP Prefix (PCIe r4.0, sec 6.20). Sec 2.2.10.2 says It is an error to receive a TLP with an End-End TLP Prefix by a Receiver that does not support End-End TLP Prefixes. A TLP in violation of this rule is handled as a Malformed TLP. This is a reported error associated with the Receiving Port (see Section 6.2). Prevent error condition by proactively requiring End-End TLP prefix to be supported on the entire data path between the endpoint and the root port before enabling PASID. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/ats.c')
-rw-r--r--drivers/pci/ats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index 4923a2a8e14b..5b78f3b1b918 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -273,6 +273,9 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
if (WARN_ON(pdev->pasid_enabled))
return -EBUSY;
+ if (!pdev->eetlp_prefix_path)
+ return -EINVAL;
+
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
if (!pos)
return -EINVAL;