linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] PCI: enable ASPM configuration in PCIE POWERSAVE mode
@ 2014-07-01  7:16 Vidya Sagar
  2014-07-01 15:04 ` Stephen Warren
  2014-07-05 18:57 ` Bjorn Helgaas
  0 siblings, 2 replies; 12+ messages in thread
From: Vidya Sagar @ 2014-07-01  7:16 UTC (permalink / raw)
  To: bhelgaas, rjw, nagananda.chumbalkar, thierry.reding, swarren,
	kthota, linux-pci
  Cc: linux-kernel, Vidya Sagar

commit 1a680b7c moved pcie_aspm_powersave_config_link() out of
pci_raw_set_power_state() to pci_set_power_state() which would enable
ASPM. But, with commit db288c9c, which re-introduced the following check
./drivers/pci/pci.c: pci_set_power_state()
+   /* Check if we're already there */
+   if (dev->current_state == state)
+       return 0;
in pci_set_power_state(), call to pcie_aspm_powersave_config_link() is never
made leaving ASPM broken.
Fix it by not returning from when the above condition is true, rather, jump to
ASPM configuration code and exit from there eventually.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
 drivers/pci/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1c8592b..ded24c4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -804,7 +804,7 @@ EXPORT_SYMBOL_GPL(__pci_complete_power_transition);
  */
 int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 {
-	int error;
+	int error = 0;
 
 	/* bound the state we're entering */
 	if (state > PCI_D3cold)
@@ -821,7 +821,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
 	/* Check if we're already there */
 	if (dev->current_state == state)
-		return 0;
+		goto config_aspm;
 
 	__pci_start_power_transition(dev, state);
 
@@ -839,6 +839,8 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
 	if (!__pci_complete_power_transition(dev, state))
 		error = 0;
+
+config_aspm:
 	/*
 	 * When aspm_policy is "powersave" this call ensures
 	 * that ASPM is configured.
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-07-14  4:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01  7:16 [PATCH v1] PCI: enable ASPM configuration in PCIE POWERSAVE mode Vidya Sagar
2014-07-01 15:04 ` Stephen Warren
2014-07-02  4:23   ` Vidya Sagar
2014-07-05 18:57 ` Bjorn Helgaas
2014-07-05 19:02   ` Bjorn Helgaas
2014-07-07 16:02     ` Matthew Garrett
2014-07-07 18:00     ` Vidya Sagar
2014-07-07 21:12       ` Bjorn Helgaas
2014-07-08  5:07         ` Vidya Sagar
2014-07-09 18:20         ` vidya sagar
2014-07-11 22:44           ` Bjorn Helgaas
2014-07-14  4:35             ` vidya sagar

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