Skip to content

Commit ed831e7

Browse files
ffainellibjorn-helgaas
authored andcommitted
PCI: brcmstb: Assign pcie->gen from of_pci_get_max_link_speed()
After commit 03f9209 ("PCI: controller: Validate max-link-speed"), pcie->gen stopped being assigned and as a result the established PCIe link would stop supporting Gen3 speeds on 2712 since pcie->gen is used to populate LnkCntl2 and LnkCap in brcm_pcie_set_gen(). If the 'max-link-speed' property is not specified, or it exceeds Gen3, resort to the HW defaults. Link: raspberrypi/linux#7343 Reported-by: Dom Cobley <popcornmix@gmail.com> Reported-by: Phil Elwell <phil@raspberrypi.com> Fixes: 03f9209 ("PCI: controller: Validate max-link-speed") Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Hans Zhang <18255117159@163.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20260506164537.103196-1-florian.fainelli@broadcom.com
1 parent 439e16c commit ed831e7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,8 +2072,10 @@ static int brcm_pcie_probe(struct platform_device *pdev)
20722072
return PTR_ERR(pcie->clk);
20732073

20742074
ret = of_pci_get_max_link_speed(np);
2075-
if (pcie_get_link_speed(ret) == PCI_SPEED_UNKNOWN)
2075+
if (ret < 0 || ret > 3)
20762076
pcie->gen = 0;
2077+
else
2078+
pcie->gen = ret;
20772079

20782080
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
20792081

0 commit comments

Comments
 (0)