aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorDavid E. Box <david.e.box@linux.intel.com>2020-12-07 14:39:50 -0800
committerBjorn Helgaas <bhelgaas@google.com>2020-12-10 14:43:54 -0600
commit39850ed51062f89cd46214a16aaafba5ca49fd6c (patch)
treeb8cb10061b1aecb2eb14001219f1bf8277565354 /drivers/pci/pci.h
parentLinux 5.10-rc3 (diff)
downloadlinux-dev-39850ed51062f89cd46214a16aaafba5ca49fd6c.tar.xz
linux-dev-39850ed51062f89cd46214a16aaafba5ca49fd6c.zip
PCI/PTM: Save/restore Precision Time Measurement Capability for suspend/resume
The PCI subsystem does not currently save and restore the configuration space for the Precision Time Measurement (PTM) Extended Capability leading to the possibility of the feature returning disabled on S3 resume. This has been observed on Intel Coffee Lake desktops. Add save/restore of the PTM control register. This saves the PTM Enable, Root Select, and Effective Granularity bits. Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20201207223951.19667-1-david.e.box@linux.intel.com Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f86cae9aa1f4..e0f9e7259e47 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -516,6 +516,14 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
#endif /* CONFIG_PCI_IOV */
+#ifdef CONFIG_PCIE_PTM
+void pci_save_ptm_state(struct pci_dev *dev);
+void pci_restore_ptm_state(struct pci_dev *dev);
+#else
+static inline void pci_save_ptm_state(struct pci_dev *dev) { }
+static inline void pci_restore_ptm_state(struct pci_dev *dev) { }
+#endif
+
unsigned long pci_cardbus_resource_alignment(struct resource *);
static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,