Commit ed831e7e authored by Florian Fainelli's avatar Florian Fainelli Committed by Bjorn Helgaas
Browse files

PCI: brcmstb: Assign pcie->gen from of_pci_get_max_link_speed()

After commit 03f92093 ("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: https://github.com/raspberrypi/linux/issues/7343


Reported-by: default avatarDom Cobley <popcornmix@gmail.com>
Reported-by: default avatarPhil Elwell <phil@raspberrypi.com>
Fixes: 03f92093 ("PCI: controller: Validate max-link-speed")
Signed-off-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarHans Zhang <18255117159@163.com>
Reviewed-by: default avatarManivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260506164537.103196-1-florian.fainelli@broadcom.com
parent 439e16c9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2072,8 +2072,10 @@ static int brcm_pcie_probe(struct platform_device *pdev)
		return PTR_ERR(pcie->clk);

	ret = of_pci_get_max_link_speed(np);
	if (pcie_get_link_speed(ret) == PCI_SPEED_UNKNOWN)
	if (ret < 0 || ret > 3)
		pcie->gen = 0;
	else
		pcie->gen = ret;

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