From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2723BCD4F3C for ; Fri, 15 May 2026 18:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=hT2axnghXXd+OE+1RPcRkjtfsjCKi0HtJ8nHAev22zg=; b=eO02Ez2KK+Hpw5 zXjgQ8L1Y6+SdrH72caOqQt0/Kw99FnFw2Ie8f0jX0J3khuxsZGS/xAMXRyvvVn/wu1rDCI7txzGe +Ww/XYF3lLCF02E7Uo+DfdwQRwTTs8C+2xV0tH2IbIKaaF4HiK3xLnWBG8Rzy8bAIWxUuCOYYE8gj N0AhY/k21+I41kK10kIWRl/JhUk76cOgqgP4FkqSn5R0druaW4kC529l4HNv+B5wp19/cltNdGUPq r0K9EbSSV7Y2ZWvsfZVBoG3hCljBb/2hnv/bOyETjtcdIxwzIDnOfvF8jwAvwWJEofapRr/ujNefG CCwy0c5fvhuYWgh5eYhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wNx3U-0000000947O-0KpK; Fri, 15 May 2026 18:14:36 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wNx3S-00000009476-0sB9; Fri, 15 May 2026 18:14:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3B205600FC; Fri, 15 May 2026 18:14:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1072C2BCB0; Fri, 15 May 2026 18:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778868872; bh=s/joay8SWXDw6yqU8I34kjBc3z3fFJJ+aAAgSOP8Uj8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=p71fEosAwm4sa42reA6Ycd/eE63vRXoa7txtMBRP1VFKeeDqUzCs4g9/HbDEkuCpT DUapKMiyCA2gZXO2Gqg2cKGbxhn/1AK/DM9XmCqgiU1NAqvcxJGxrriVHCFhcdYmnf EZsQpiMmyS8ZxBr474vAZ+dDEXahUaRx4CBDKSNDr70Hcm4dyd0b285ihsZWV8f3dT f18V4u7Iq1U15rocD4iVQaJHrAoMSC2UxVINZ36Oc5V5j6LW9sEvSxjzBtdpYwk9l7 a0hAfrjfTSvruuVkIl5LhyM6r6tEWjXkYRIZmp+3D7qkjBzGYKPS2g2KVWRSwCGmvN j44S0+P85PbiA== Date: Fri, 15 May 2026 13:14:31 -0500 From: Bjorn Helgaas To: Florian Fainelli Cc: linux-pci@vger.kernel.org, Dom Cobley , Phil Elwell , Jim Quinlan , Broadcom internal kernel review list , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Hans Zhang <18255117159@163.com>, "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v2] PCI: brcmstb: Assign pcie->gen from of_pci_get_max_link_speed() Message-ID: <20260515181431.GA505137@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260506164537.103196-1-florian.fainelli@broadcom.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 06, 2026 at 09:45:37AM -0700, Florian Fainelli wrote: > After commit 03f920936977 ("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(). > > Whether 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: Dom Cobley > Reported-by: Phil Elwell > Fixes: 03f920936977 ("PCI: controller: Validate max-link-speed") > Signed-off-by: Florian Fainelli > Change-Id: Ic5431469dd7a6c8b391f84f27119dad876256880 Applied to pci/for-linus for v7.1, thanks! Sashiko pointed out a couple issues, but they're unrelated to this patch, so I'll watch for future patches to address them. > --- > Changes in v2: > > - utilize of_pci_get_max_link_speed() directly > - also validate against exceeding Gen3 > > drivers/pci/controller/pcie-brcmstb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index 714bcab97b60..08a0e7091ced 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -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"); > > -- > 2.34.1 >