Message ID | 20210604220933.3974558-3-vinicius.gomes@intel.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | igc: Add support for PCIe PTM | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Guessed tree name to be net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 1 maintainers not CCed: david.e.box@linux.intel.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 7602 this patch: 7602 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 24 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8134 this patch: 8134 |
netdev/header_inline | success | Link |
On Fri, Jun 04, 2021 at 03:09:31PM -0700, Vinicius Costa Gomes wrote: > Adds a predicate that returns if PCIe PTM (Precision Time Measurement) > is enabled. Ideally, "Add a predicate ..." > 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> But either way, Acked-by: Bjorn Helgaas <bhelgaas@google.com> > --- > drivers/pci/pcie/ptm.c | 9 +++++++++ > include/linux/pci.h | 3 +++ > 2 files changed, 12 insertions(+) > > diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c > index 95d4eef2c9e8..8a4ad974c5ac 100644 > --- a/drivers/pci/pcie/ptm.c > +++ b/drivers/pci/pcie/ptm.c > @@ -204,3 +204,12 @@ int pci_enable_ptm(struct pci_dev *dev, u8 *granularity) > return 0; > } > EXPORT_SYMBOL(pci_enable_ptm); > + > +bool pcie_ptm_enabled(struct pci_dev *dev) > +{ > + if (!dev) > + return false; > + > + return dev->ptm_enabled; > +} > +EXPORT_SYMBOL(pcie_ptm_enabled); > diff --git a/include/linux/pci.h b/include/linux/pci.h > index a687dda262dd..fe7f264b2b15 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1619,9 +1619,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); > -- > 2.31.1 >
diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index 95d4eef2c9e8..8a4ad974c5ac 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -204,3 +204,12 @@ int pci_enable_ptm(struct pci_dev *dev, u8 *granularity) return 0; } EXPORT_SYMBOL(pci_enable_ptm); + +bool pcie_ptm_enabled(struct pci_dev *dev) +{ + if (!dev) + return false; + + return dev->ptm_enabled; +} +EXPORT_SYMBOL(pcie_ptm_enabled); diff --git a/include/linux/pci.h b/include/linux/pci.h index a687dda262dd..fe7f264b2b15 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1619,9 +1619,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);
Adds 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> --- drivers/pci/pcie/ptm.c | 9 +++++++++ include/linux/pci.h | 3 +++ 2 files changed, 12 insertions(+)