linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	sasha.neftin@intel.com, andre.guedes@intel.com,
	anthony.l.nguyen@intel.com, linux-pci@vger.kernel.org,
	bhelgaas@google.com, netdev@vger.kernel.org
Subject: [PATCH next-queue v2 1/3] Revert "PCI: Make pci_enable_ptm() private"
Date: Mon,  9 Nov 2020 22:10:17 -0800	[thread overview]
Message-ID: <20201110061019.519589-2-vinicius.gomes@intel.com> (raw)
In-Reply-To: <20201110061019.519589-1-vinicius.gomes@intel.com>

Make pci_enable_ptm() accessible from the drivers.

Even if PTM still works on the platform I am using without calling
this function, it might be possible that it's not always the case.

Exposing this to the driver enables the driver to use the
'ptm_enabled' field of 'pci_dev' to check if PTM is enabled or not.

This reverts commit ac6c26da29c12fa511c877c273ed5c939dc9e96c.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
 drivers/pci/pci.h   | 3 ---
 include/linux/pci.h | 7 +++++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f86cae9aa1f4..548e93aca55b 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -581,11 +581,8 @@ static inline void pcie_ecrc_get_policy(char *str) { }
 
 #ifdef CONFIG_PCIE_PTM
 void pci_ptm_init(struct pci_dev *dev);
-int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
 #else
 static inline void pci_ptm_init(struct pci_dev *dev) { }
-static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
-{ return -EINVAL; }
 #endif
 
 struct pci_dev_reset_methods {
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 22207a79762c..18ce0d3eaecc 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1596,6 +1596,13 @@ static inline bool pci_aer_available(void) { return false; }
 
 bool pci_ats_disabled(void);
 
+#ifdef CONFIG_PCIE_PTM
+int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
+#else
+static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
+{ return -EINVAL; }
+#endif
+
 void pci_cfg_access_lock(struct pci_dev *dev);
 bool pci_cfg_access_trylock(struct pci_dev *dev);
 void pci_cfg_access_unlock(struct pci_dev *dev);
-- 
2.29.0


  reply	other threads:[~2020-11-10  6:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  6:10 [PATCH next-queue v2 0/3] igc: Add support for PCIe PTM Vinicius Costa Gomes
2020-11-10  6:10 ` Vinicius Costa Gomes [this message]
2020-11-10  6:10 ` [PATCH next-queue v2 2/3] igc: Enable " Vinicius Costa Gomes
2020-11-10  6:10 ` [PATCH next-queue v2 3/3] igc: Add support for PTP getcrosststamp() Vinicius Costa Gomes
2020-11-10 18:07   ` [Intel-wired-lan] " Miroslav Lichvar
2020-11-10 19:06     ` Vinicius Costa Gomes
2020-11-11  9:33       ` Miroslav Lichvar
2020-11-11 22:23         ` Vinicius Costa Gomes
2020-11-12  9:32           ` Miroslav Lichvar
2020-11-12 23:46             ` Vinicius Costa Gomes
2020-11-13  3:24               ` Richard Cochran
2020-11-13 19:10                 ` Vinicius Costa Gomes
2020-11-14  2:57                   ` Richard Cochran
2020-11-17  1:06                     ` Vinicius Costa Gomes
2020-11-17  1:49                       ` Richard Cochran
2020-11-18  1:21                         ` Vinicius Costa Gomes
2020-11-18 12:54                           ` Richard Cochran
2020-11-19  0:22                             ` Vinicius Costa Gomes
2020-11-20 14:16                               ` Richard Cochran
2020-11-20 17:58                                 ` Vinicius Costa Gomes
2021-03-22 15:36                             ` Vinicius Costa Gomes
2021-03-23  4:17                               ` Richard Cochran
2020-11-18 15:55                           ` Jakub Kicinski
2020-11-20 19:07                             ` Vinicius Costa Gomes
2020-11-12  0:38     ` Vinicius Costa Gomes
2021-03-22 15:47     ` Vinicius Costa Gomes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201110061019.519589-2-vinicius.gomes@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=andre.guedes@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bhelgaas@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sasha.neftin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).