提交 56211626 编写于 作者: V Vinicius Costa Gomes 提交者: Zheng Zengkai

Revert "PCI: Make pci_enable_ptm() private"

stable inclusion
from stable-v5.10.124
commit f0a7adff635af904cb96aef95b6468cf18d01045
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f0a7adff635af904cb96aef95b6468cf18d01045

--------------------------------

commit 1d71eb53 upstream.

Make pci_enable_ptm() accessible from the drivers.

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 ac6c26da ("PCI: Make pci_enable_ptm() private").
Signed-off-by: NVinicius Costa Gomes <vinicius.gomes@intel.com>
Acked-by: NBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NMeng Tang <tangmeng@uniontech.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 c286add4
...@@ -619,11 +619,8 @@ static inline void pcie_ecrc_get_policy(char *str) { } ...@@ -619,11 +619,8 @@ static inline void pcie_ecrc_get_policy(char *str) { }
#ifdef CONFIG_PCIE_PTM #ifdef CONFIG_PCIE_PTM
void pci_ptm_init(struct pci_dev *dev); void pci_ptm_init(struct pci_dev *dev);
int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
#else #else
static inline void pci_ptm_init(struct pci_dev *dev) { } 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 #endif
struct pci_dev_reset_methods { struct pci_dev_reset_methods {
......
...@@ -1652,6 +1652,13 @@ static inline bool pci_aer_available(void) { return false; } ...@@ -1652,6 +1652,13 @@ static inline bool pci_aer_available(void) { return false; }
bool pci_ats_disabled(void); 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); void pci_cfg_access_lock(struct pci_dev *dev);
bool pci_cfg_access_trylock(struct pci_dev *dev); bool pci_cfg_access_trylock(struct pci_dev *dev);
void pci_cfg_access_unlock(struct pci_dev *dev); void pci_cfg_access_unlock(struct pci_dev *dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册