linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Cc: ath9k-devel@venema.h4ckr.net, camilo@mesias.co.uk,
	Jonathan Nieder <jrnieder@gmail.com>,
	Tony Houghton <h@realh.co.uk>,
	Rajkumar Manoharan <rmanoharan@atheros.com>,
	ath9k-devel@venema.h4ckr.net, Adrian Chadd <adrian@freebsd.org>,
	<lrodriguez@atheros.com>
Subject: [PATCH -next 7/8] pci: aspm: add settings changed callback
Date: Fri,  5 Aug 2011 13:10:38 +0200	[thread overview]
Message-ID: <1312542639-4274-8-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1312542639-4274-1-git-send-email-sgruszka@redhat.com>

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(-)

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


  parent reply	other threads:[~2011-08-05 11:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 11:10 [PATCH -next 0/8] ath9k: ASPM fixes Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 1/8] ath9k: remove ->config_pci_powersave() redundant argument Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 2/8] ath9k: merge common ->config_pci_powersave() checks Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 3/8] ath9k: do btcoex ASPM disabling at initialization time Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 4/8] pci: aspm: add function for disabling ASPM Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 5/8] ath9k: use common " Stanislaw Gruszka
2011-08-05 11:10 ` [PATCH -next 6/8] e1000e: " Stanislaw Gruszka
2011-08-05 11:10 ` Stanislaw Gruszka [this message]
2011-08-05 11:10 ` [PATCH -next 8/8] ath9k: be prepare for dynamic ASPM settings change Stanislaw Gruszka
2011-08-11 16:08 ` [PATCH -next 0/8] ath9k: ASPM fixes John W. Linville
2011-08-12 12:35   ` Stanislaw Gruszka
2011-08-12 18:49     ` Jeff Kirsher
2011-08-17 15:41       ` Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312542639-4274-8-git-send-email-sgruszka@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=adrian@freebsd.org \
    --cc=ath9k-devel@venema.h4ckr.net \
    --cc=camilo@mesias.co.uk \
    --cc=h@realh.co.uk \
    --cc=jrnieder@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=rmanoharan@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).