At the moment, the ATS functions are only defined when CONFIG_PCI is enabled. Since we're about to use them in the Arm SMMUv3 driver, which could be built with CONFIG_PCI disabled, and they are already guarded by CONFIG_PCI_ATS which depends on CONFIG_PCI, move the definitions outside of CONFIG_PCI.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -1521,21 +1521,6 @@ static inline void pcie_ecrc_get_policy(char *str) { } · 1520 unmodified lines | |||
| 1521 | 1521 | ||
| 1522 | bool pci_ats_disabled(void); | 1522 | bool pci_ats_disabled(void); |
| 1523 | 1523 | ||
| 1524 | #ifdef CONFIG_PCI_ATS | ||
| 1525 | /* Address Translation Service */ | ||
| 1526 | void pci_ats_init(struct pci_dev *dev); | ||
| 1527 | int pci_enable_ats(struct pci_dev *dev, int ps); | ||
| 1528 | void pci_disable_ats(struct pci_dev *dev); | ||
| 1529 | int pci_ats_queue_depth(struct pci_dev *dev); | ||
| 1530 | int pci_ats_page_aligned(struct pci_dev *dev); | ||
| 1531 | #else | ||
| 1532 | static inline void pci_ats_init(struct pci_dev *d) { } | ||
| 1533 | static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; } | ||
| 1534 | static inline void pci_disable_ats(struct pci_dev *d) { } | ||
| 1535 | static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; } | ||
| 1536 | static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; } | ||
| 1537 | #endif | ||
| 1538 | |||
| 1539 | #ifdef CONFIG_PCIE_PTM | 1524 | #ifdef CONFIG_PCIE_PTM |
| 1540 | int pci_enable_ptm(struct pci_dev *dev, u8 *granularity); | 1525 | int pci_enable_ptm(struct pci_dev *dev, u8 *granularity); |
| 1541 | #else | 1526 | #else |
| @@ -1730,6 +1715,21 @@ static inline const struct pci_device_id *pci_match_id(const struct pci_device_i · 188 unmodified lines | |||
| 1730 | { return NULL; } | 1715 | { return NULL; } |
| 1731 | #endif /* CONFIG_PCI */ | 1716 | #endif /* CONFIG_PCI */ |
| 1732 | 1717 | ||
| 1718 | #ifdef CONFIG_PCI_ATS | ||
| 1719 | /* Address Translation Service */ | ||
| 1720 | void pci_ats_init(struct pci_dev *dev); | ||
| 1721 | int pci_enable_ats(struct pci_dev *dev, int ps); | ||
| 1722 | void pci_disable_ats(struct pci_dev *dev); | ||
| 1723 | int pci_ats_queue_depth(struct pci_dev *dev); | ||
| 1724 | int pci_ats_page_aligned(struct pci_dev *dev); | ||
| 1725 | #else | ||
| 1726 | static inline void pci_ats_init(struct pci_dev *d) { } | ||
| 1727 | static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; } | ||
| 1728 | static inline void pci_disable_ats(struct pci_dev *d) { } | ||
| 1729 | static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; } | ||
| 1730 | static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; } | ||
| 1731 | #endif | ||
| 1732 | |||
| 1733 | /* Include architecture-dependent settings and functions */ | 1733 | /* Include architecture-dependent settings and functions */ |
| 1734 | 1734 | ||
| 1735 | #include <asm/pci.h> | 1735 | #include <asm/pci.h> |