Search Linux Wireless

[RFC/RFT v2 10/12] pci: aspm: add settings changed callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Inform drivers that register pci_drviver->aspm_changed(), about new ASPM
settings. Callback is only called for child (endpoint) devices.

Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Cc: linux-pci@xxxxxxxxxxxxxxx
Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
---
 drivers/pci/pcie/aspm.c |    5 ++++-
 include/linux/pci.h     |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 2883fc3..d7acec8 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -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);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5c..2110d63 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -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;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux