diff mbox series

[next-queue,v4,1/4] Revert "PCI: Make pci_enable_ptm() private"

Message ID 20210604220933.3974558-2-vinicius.gomes@intel.com (mailing list archive)
State Superseded
Headers show
Series igc: Add support for PCIe PTM | expand

Commit Message

Vinicius Costa Gomes June 4, 2021, 10:09 p.m. UTC
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.

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

Comments

Bjorn Helgaas June 4, 2021, 10:25 p.m. UTC | #1
On Fri, Jun 04, 2021 at 03:09:30PM -0700, Vinicius Costa Gomes wrote:
> 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.

Not really relevant to this commit, strictly speaking.

> 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.

Ideally I would cite this as ac6c26da29c1 ("PCI: Make pci_enable_ptm()
private") so there's a little more context.

> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Acked regardless of the above.

> ---
>  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 37c913bbc6e1..32dab36c717e 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -593,11 +593,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 c20211e59a57..a687dda262dd 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1617,6 +1617,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.31.1
>
Vinicius Costa Gomes June 4, 2021, 11:27 p.m. UTC | #2
Bjorn Helgaas <helgaas@kernel.org> writes:

> On Fri, Jun 04, 2021 at 03:09:30PM -0700, Vinicius Costa Gomes wrote:
>> 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.
>
> Not really relevant to this commit, strictly speaking.
>

Will remove then.

>> 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.
>
> Ideally I would cite this as ac6c26da29c1 ("PCI: Make pci_enable_ptm()
> private") so there's a little more context.
>

Yeah, that looks better.

Will follow the suggestions you made in the next patch as well and send
another version, thanks.


Cheers,
Paul Menzel June 5, 2021, 5:47 a.m. UTC | #3
Dear Vinicius, dear Bjorn,


Am 05.06.21 um 01:27 schrieb Vinicius Costa Gomes:
> Bjorn Helgaas <helgaas@kernel.org> writes:
> 
>> On Fri, Jun 04, 2021 at 03:09:30PM -0700, Vinicius Costa Gomes wrote:

[…]

>>> 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.
>>
>> Ideally I would cite this as ac6c26da29c1 ("PCI: Make pci_enable_ptm()
>> private") so there's a little more context.
> 
> Yeah, that looks better.
> 
> Will follow the suggestions you made in the next patch as well and send
> another version, thanks.

Just a note, that this is how revert commits are generated by `git 
revert` as the name of the reverted commit is in the commit message 
summary. Maybe just move the statement/sentence to the very top? But 
either way is fine.


Kind regards,

Paul
diff mbox series

Patch

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 37c913bbc6e1..32dab36c717e 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -593,11 +593,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 c20211e59a57..a687dda262dd 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1617,6 +1617,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);