Skip to content

Commit

Permalink
PCI: altera: Check link status before retrain link
Browse files Browse the repository at this point in the history
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@altera.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Ley Foon Tan authored and Bjorn Helgaas committed Jul 22, 2016
1 parent f8be11a commit c622032
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pci/host/pcie-altera.c
Original file line number Diff line number Diff line change
@@ -100,6 +100,10 @@ static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
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

0 comments on commit c622032

Please sign in to comment.