[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190115154853.319380189@linuxfoundation.org>
Date:   Tue, 15 Jan 2019 17:35:38 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        stable@...r.kernel.org, Ley Foon Tan <lftan@...era.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Claudius Heine <claudius.heine.ext@...mens.com>
Subject: [PATCH 4.4 42/51] PCI: altera: Check link status before retrain link
4.4-stable review patch.  If anyone has any objections, please let me know.
------------------
From: Ley Foon Tan <lftan@...era.com>
commit c622032ebc538cb3869c312ae3ad235a99da84b6 upstream.
Check the link status before retraining.  If the link is not up, don't
bother trying to retrain it.
[bhelgaas: split code move to separate patch, changelog]
Signed-off-by: Ley Foon Tan <lftan@...era.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Claudius Heine <claudius.heine.ext@...mens.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/pci/host/pcie-altera.c |    4 ++++
 1 file changed, 4 insertions(+)
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -100,6 +100,10 @@ static bool altera_pcie_link_is_up(struc
 static void altera_pcie_retrain(struct pci_dev *dev)
 {
 	u16 linkcap, linkstat;
+	struct altera_pcie *pcie = dev->bus->sysdata;
+
+	if (!altera_pcie_link_is_up(pcie))
+		return;
 
 	/*
 	 * Set the retrain bit if the PCIe rootport support > 2.5GB/s, but
Powered by blists - more mailing lists