Skip to content

Commit 1461b39

Browse files
P33Mpopcornmix
authored andcommitted
PCI: brcmstb: set link speed before deasserting fundamental reset
If autonomous speed negotiation is unreliable then brcm_pcie_set_gen() can be used to override/limit this behaviour. However, setting the limit after the linkup poll means the link can temporarily enter a bad speed which may result in link failure. Move the speed setup to just prior to releasing perst_n. Fixes: 0693b42 ("PCI: brcmstb: Split post-link up initialization to brcm_pcie_start_link()") Signed-off-by: Jonathan Bell <[email protected]>
1 parent c53dafd commit 1461b39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,9 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)
17151715
u16 tmp16;
17161716
int ret, i;
17171717

1718+
if (pcie->gen)
1719+
brcm_pcie_set_gen(pcie, pcie->gen);
1720+
17181721
/* Unassert the fundamental reset */
17191722
if (pcie->tperst_clk_ms) {
17201723
/*
@@ -1759,9 +1762,6 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)
17591762

17601763
brcm_config_clkreq(pcie);
17611764

1762-
if (pcie->gen)
1763-
brcm_pcie_set_gen(pcie, pcie->gen);
1764-
17651765
if (pcie->ssc) {
17661766
ret = brcm_pcie_set_ssc(pcie);
17671767
if (ret == 0)

0 commit comments

Comments
 (0)