@@ -474,8 +474,11 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
*/
if (state & ASPM_STATE_L1)
pcie_config_aspm_dev(parent, upstream);
- list_for_each_entry(child, &linkbus->devices, bus_list)
+ list_for_each_entry(child, &linkbus->devices, bus_list) {
pcie_config_aspm_dev(child, dwstream);
+ if (child->driver && child->driver->aspm_changed)
+ child->driver->aspm_changed(child, dwstream);
+ }
if (!(state & ASPM_STATE_L1))
pcie_config_aspm_dev(parent, upstream);
@@ -555,6 +555,9 @@ struct pci_driver {
int (*resume_early) (struct pci_dev *dev);
int (*resume) (struct pci_dev *dev); /* Device woken up */
void (*shutdown) (struct pci_dev *dev);
+#ifdef CONFIG_PCIEASPM
+ void (*aspm_changed) (struct pci_dev *dev, u32 state);
+#endif
struct pci_error_handlers *err_handler;
struct device_driver driver;
struct pci_dynids dynids;
Inform drivers that register pci_drviver->aspm_changed(), about new ASPM settings. Callback is only called for child (endpoint) devices. Currently this will be used in ath9k driver. In the future we most likely will use it in iwlwifi and rtlwifi drivers and possibly some others that needs to do own ASPM related quirks. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: linux-pci@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> --- drivers/pci/pcie/aspm.c | 5 ++++- include/linux/pci.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletions(-)