Skip to content

Commit

Permalink
PCI: brcmstb: set link speed before deasserting fundamental reset
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
P33M authored and pelwell committed Nov 22, 2024
1 parent ab9bb48 commit 91df66d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pci/controller/pcie-brcmstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,9 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)
u16 tmp16;
int ret, i;

if (pcie->gen)
brcm_pcie_set_gen(pcie, pcie->gen);

/* Unassert the fundamental reset */
if (pcie->tperst_clk_ms) {
/*
Expand Down Expand Up @@ -1759,9 +1762,6 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)

brcm_config_clkreq(pcie);

if (pcie->gen)
brcm_pcie_set_gen(pcie, pcie->gen);

if (pcie->ssc) {
ret = brcm_pcie_set_ssc(pcie);
if (ret == 0)
Expand Down

0 comments on commit 91df66d

Please sign in to comment.