Drivers may rely on pci_disable_link_state() having disabled certain ASPM link states. If OS can't control ASPM then pci_disable_link_state() turns into a no-op w/o informing the caller. The driver therefore may falsely assume the respective ASPM link states are disabled. Let pci_disable_link_state() propagate errors to the caller, enabling the caller to react accordingly.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -24,11 +24,12 @@ · 23 unmodified lines | |||
| 24 | #define PCIE_LINK_STATE_CLKPM 4 | 24 | #define PCIE_LINK_STATE_CLKPM 4 |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_PCIEASPM | 26 | #ifdef CONFIG_PCIEASPM |
| 27 | void pci_disable_link_state(struct pci_dev *pdev, int state); | 27 | int pci_disable_link_state(struct pci_dev *pdev, int state); |
| 28 | void pci_disable_link_state_locked(struct pci_dev *pdev, int state); | 28 | int pci_disable_link_state_locked(struct pci_dev *pdev, int state); |
| 29 | void pcie_no_aspm(void); | 29 | void pcie_no_aspm(void); |
| 30 | #else | 30 | #else |
| 31 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) { } | 31 | static inline int pci_disable_link_state(struct pci_dev *pdev, int state) |
| 32 | { return 0; } | ||
| 32 | static inline void pcie_no_aspm(void) { } | 33 | static inline void pcie_no_aspm(void) { } |
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||