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 A6F89CAC5B5 for ; Sun, 28 Sep 2025 09:33:22 +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:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VPEZ2slxEgiEnEN/yw8WRtg0U6RJVIXJDPY6/ShvA0Y=; b=JxWf5j6x99sATlEc1W9tgQ1dkZ hDloHpnL//E0S/s4Ym6msIGn+ykrl+7Pbf/Cm2TmqzYsa16uutm0bRjNRUpmuL5FhI/o9kOldlg6H vC9Jkiuh2HTizUEdgATczbp4yi/q1iF0U1EnF3rHlc0z956PL6Cocw4dFa26dpJRWLpIcu0kkyr5r BEPg/nFbA682fYI5aSA5NFRI+sdrh0PWKa8TLzr1KdnBPhLpMD/P+e4ZqUSPnM2GA0rDrhh8nYW/n s1sDUoR+Ngxy60z8ejbdjDYo9ihJjgrYmS8a5speBPTLOu093kCO2gPP0DfzSr2eMw+hEkwxh8QSj udVknZyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v2nmP-0000000Eh5y-2m8j; Sun, 28 Sep 2025 09:33:17 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v2nmN-0000000Eh3y-1nZd for linux-arm-kernel@lists.infradead.org; Sun, 28 Sep 2025 09:33:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VPEZ2slxEgiEnEN/yw8WRtg0U6RJVIXJDPY6/ShvA0Y=; b=cQ9hWWBeyxlEtK8maNLOHv142T ltuJVinY5M6saGBBPY7k0mRIsioIU2MZIbe+CFc5b03i1DMqmSVmUOTyjINj+tZFLcrujl6fkFQ/3 vi9WZeaqq5JG5kWpcZb58qTKBdjidoCNzUiknBuYdUtztpmbNb+1xMviU2GvYG/wSwuuE+u1HF9z5 Z5hqdQhynzm48PNVYjERTuLspPo6OScBUR07bli+7ZpMHGAL9j6Kfi0PKlC01VXzmEGTK8ZIYUw+f TwiiL54IctItylllafNtwx3cgziCsjyNTNLHFQ4PhZLV44bgv9awuse7/7cjtwie3PWRdclO0VQXy bZkJ+rSQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:34138 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v2nao-000000005IM-1c1s; Sun, 28 Sep 2025 10:21:19 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1v2naa-00000007oHA-3GXU; Sun, 28 Sep 2025 10:21:04 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Abhishek Chauhan , Alexandre Torgue , Alexis Lothore , "Alexis Lothor__" , Andrew Lunn , Boon Khai Ng , Choong Yong Liang , Daniel Machon , "David S. Miller" , Eric Dumazet , Faizal Rahim , Furong Xu <0x1207@gmail.com>, Huacai Chen , Inochi Amaoto , Jacob Keller , Jakub Kicinski , "Jan Petrous (OSS)" , Jisheng Zhang , Kees Cook , Kunihiko Hayashi , Lad Prabhakar , Ley Foon Tan , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Mateusz Polchlopek , Matthew Gerlach , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Oleksij Rempel , Paolo Abeni , Rohan G Thomas , Shenwei Wang , Simon Horman , Song Yoong Siang , Swathi K S , Tiezhu Yang , Vinod Koul , Vladimir Oltean , Vladimir Oltean , Yu-Chun Lin Subject: [PATCH RFC net-next v2 12/19] net: stmmac: only call stmmac_pcs_ctrl_ane() for integrated SGMII PCS MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Date: Sun, 28 Sep 2025 10:21:04 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250928_023315_473654_4D0BD13C X-CRM114-Status: GOOD ( 13.11 ) 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 The internal PCS registers only exist if the core is synthesized with SGMII, TBI or RTBI support. They have no relevance for RGMII. However, priv->hw->pcs contains a STMMAC_PCS_RGMII flag, which is set if a PCS has been synthesized but we are operating in RGMII mode. As the register has no effect for RGMII, there is no point calling stmmac_pcs_ctrl_ane() in this case. Add a comment describing this and make it conditional on STMMAC_PCS_SGMII. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e2d9c08aace8..ee48991d336d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3488,7 +3488,11 @@ static int stmmac_hw_setup(struct net_device *dev) } } - if (priv->hw->pcs) + /* The PCS control register is only relevant for SGMII, TBI and RTBI + * modes. We no longer support TBI or RTBI, so only configure this + * register when operating in SGMII mode with the integrated PCS. + */ + if (priv->hw->pcs & STMMAC_PCS_SGMII) stmmac_pcs_ctrl_ane(priv, 1, priv->hw->reverse_sgmii_enable); /* set TX and RX rings length */ -- 2.47.3