aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVinicius Costa Gomes2021-07-26 20:36:55 -0700
committerTony Nguyen2021-08-24 11:36:13 -0700
commit014408cd624e9fd2820f4a593b710325ee05fec9 (patch)
tree87b6e088042f95030f03c5e464c0d813c980ddcb /include
parent1d71eb53e45187f58089d32b51e27784c791d90e (diff)
PCI: Add pcie_ptm_enabled()
Add a predicate that returns if PCIe PTM (Precision Time Measurement) is enabled. It will only return true if it's enabled in all the ports in the path from the device to the root. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 21a9d244e4e4..947430637cac 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1622,9 +1622,12 @@ bool pci_ats_disabled(void);
#ifdef CONFIG_PCIE_PTM
int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
+bool pcie_ptm_enabled(struct pci_dev *dev);
#else
static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
{ return -EINVAL; }
+static inline bool pcie_ptm_enabled(struct pci_dev *dev)
+{ return false; }
#endif
void pci_cfg_access_lock(struct pci_dev *dev);