linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: altera: Retrain link in rootport mode only
@ 2016-08-19  8:24 Ley Foon Tan
  2016-08-22 15:47 ` Bjorn Helgaas
  0 siblings, 1 reply; 12+ messages in thread
From: Ley Foon Tan @ 2016-08-19  8:24 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-kernel, linux-pci, Ley Foon Tan, Ley Foon Tan

Altera PCIe IP can be configured as rootport or device and they might have
same vendor ID. It will cause the system hang issue if Altera PCIe is in
endpoint mode and work with other PCIe rootport that from other vendors.
So, add the rootport mode checking in link retrain fixup function.

Signed-off-by: Ley Foon Tan <lftan@altera.com>
---
v2: change to check PCIe type is PCI_EXP_TYPE_ROOT_PORT
---
 drivers/pci/host/pcie-altera.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 58eef99..33b6968 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -139,6 +139,9 @@ static void altera_pcie_retrain(struct pci_dev *dev)
 	u16 linkcap, linkstat;
 	struct altera_pcie *pcie = dev->bus->sysdata;
 
+	if (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT)
+		return;
+
 	if (!altera_pcie_link_is_up(pcie))
 		return;
 
-- 
1.8.2.1

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

end of thread, other threads:[~2016-09-08  0:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19  8:24 [PATCH v2] PCI: altera: Retrain link in rootport mode only Ley Foon Tan
2016-08-22 15:47 ` Bjorn Helgaas
2016-08-24  7:07   ` Ley Foon Tan
2016-08-24 17:54     ` Bjorn Helgaas
2016-08-24 18:40       ` Scott Branden
2016-08-25  5:42       ` Ley Foon Tan
2016-08-30  0:37       ` Ray Jui
2016-08-30 13:37         ` Bjorn Helgaas
2016-08-30 16:36           ` Ray Jui
2016-08-30 17:00             ` Bjorn Helgaas
2016-08-30 17:04               ` Ray Jui
2016-09-08  0:10                 ` Ray Jui

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