linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/ASPM: fix reverse ASPM L0s assignment of upstream and downstream
@ 2016-05-24  6:29 Ocean HY1 He
  2016-05-24 11:53 ` Bjorn Helgaas
  2016-05-25 16:57 ` Bjorn Helgaas
  0 siblings, 2 replies; 11+ messages in thread
From: Ocean HY1 He @ 2016-05-24  6:29 UTC (permalink / raw)
  To: bhelgaas, wangyijing, luto
  Cc: linux-pci, linux-kernel, prarit, jcm, Nagananda Chumbalkar, Ocean HY1 He

In pcie_config_aspm_link(), when convert ASPM state to
upstream/downstream ASPM register state, the upstream variable and
dwsream variable are reversed. This causes PCI/E link enter ASPM L0s
even it should be disabled and PCI/E endpoint may reset randomly.

Signed-off-by: Ocean He <hehy1@lenovo.com>
---
 drivers/pci/pcie/aspm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 2dfe7fd..3f8a44d 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -439,9 +439,9 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
 		return;
 	/* Convert ASPM state to upstream/downstream ASPM register state */
 	if (state & ASPM_STATE_L0S_UP)
-		dwstream |= PCI_EXP_LNKCTL_ASPM_L0S;
-	if (state & ASPM_STATE_L0S_DW)
 		upstream |= PCI_EXP_LNKCTL_ASPM_L0S;
+	if (state & ASPM_STATE_L0S_DW)
+		dwstream |= PCI_EXP_LNKCTL_ASPM_L0S;
 	if (state & ASPM_STATE_L1) {
 		upstream |= PCI_EXP_LNKCTL_ASPM_L1;
 		dwstream |= PCI_EXP_LNKCTL_ASPM_L1;
-- 
1.8.3.1

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

end of thread, other threads:[~2016-05-25 20:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24  6:29 [PATCH] PCI/ASPM: fix reverse ASPM L0s assignment of upstream and downstream Ocean HY1 He
2016-05-24 11:53 ` Bjorn Helgaas
2016-05-24 14:42   ` Sinan Kaya
2016-05-25 16:36     ` Bjorn Helgaas
2016-05-25 12:58   ` Ocean HY1 He
2016-05-25 16:57 ` Bjorn Helgaas
2016-05-25 17:21   ` Sinan Kaya
2016-05-25 17:50     ` Bjorn Helgaas
2016-05-25 18:19       ` Sinan Kaya
2016-05-25 18:33         ` Bjorn Helgaas
2016-05-25 20:44           ` Sinan Kaya

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