From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AED3F18027; Thu, 19 Feb 2026 12:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771505442; cv=none; b=myWQw5oRGuqkWQiq66p5/+vtbarKvEQpIAATUwzAw0QEssBe9DBZ7/YoXSr9CmyZSdKmxCe2MtDbHQnt2w918lkpbRVGE1cRYcGZPki6tz+qPeZooTL2HWLcL/8Stg11/5RLuXLo+QSw6onW9icIn97w+UVRmzZbQK0HbIbdio0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771505442; c=relaxed/simple; bh=NYtleUCk2aGZNdMEAhFojXvsqxyEgroiGvwRstD8qOk=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=rRyNYT9RBX4XUfOjRfoVU6A9uIT1tz1m/X+q6FgM92w3ti5yVIKlqNbiFfjNbCAN0iqSmIjeLLD3/rgpD4Safahk5Uzek4IpKRL295pJjN8/RuIzncaq3jyb4N7yd+Kt8+vKSf99lHCH6pM7I5P0Qk08kLzRjCzlcnw0pwAB3Gc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=tZEqxZuc; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="tZEqxZuc" 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=hXy+qZEOQnVZ1TQ7eVHl4KeCMH2Hq+n4vm2MJCw5RdM=; b=tZEqxZucuX/1jcU8pRmHuLZ+6d /9ccakLp0L3pRQL1fWOMLx1SA3A9iSe9vYiNi3fK7X6xHyHRCThgq/DKNBAkb+PKA8CefMmPnRhBK F8ocpLJY+bjuehH2eAqgrum8wd1jdABw8d3tSuNBqU3kAcIP1cOz9mHrIIKd8uRT5eRo8VXS8UW7c IAfAOFX9s1H4P8zLc3G6tCNRixWd+aLbPARNrH8JuTveBpKHO634g3dm6bnw0HopjgKldP6Lmn1bW hgylN8D4OmaZIYJcpW3Qc6Q/pU89P3s4fz3DX/BCZ8sxWZreQU8VvmW2fwVYd6JladAx/EdXH1Ba/ JhZgLgkg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48508 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 1vt3UI-000000000rO-45uj; Thu, 19 Feb 2026 12:50:35 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vt3UI-0000000A5e2-0Im5; Thu, 19 Feb 2026 12:50:34 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Mohd Ayaan Anwar , Neil Armstrong , netdev@vger.kernel.org, Paolo Abeni , Vinod Koul Subject: [PATCH RFC net-next+ 2/9] net: stmmac: qcom-ethqos: move ethqos_set_serdes_speed() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Thu, 19 Feb 2026 12:50:34 +0000 Combine ethqos_set_serdes_speed() with ethqos_mac_finish_serdes() to simplify the code. Signed-off-by: Russell King (Oracle) --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index ad5b5d950fff..57cbe800f652 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -591,14 +591,6 @@ static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos, ethqos_rgmii_macro_init(ethqos, speed); } -static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) -{ - if (ethqos->serdes_speed != speed) { - phy_set_speed(ethqos->serdes_phy, speed); - ethqos->serdes_speed = speed; - } -} - static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable) { stmmac_pcs_ctrl_ane(priv, enable, 0); @@ -683,15 +675,23 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv, phy_interface_t interface) { struct qcom_ethqos *ethqos = priv; + int speed, ret = 0; qcom_ethqos_set_sgmii_loopback(ethqos, false); + speed = SPEED_UNKNOWN; if (interface == PHY_INTERFACE_MODE_SGMII) - ethqos_set_serdes_speed(ethqos, SPEED_1000); + speed = SPEED_1000; else if (interface == PHY_INTERFACE_MODE_2500BASEX) - ethqos_set_serdes_speed(ethqos, SPEED_2500); + speed = SPEED_2500; - return 0; + if (speed != SPEED_UNKNOWN && speed != ethqos->serdes_speed) { + ret = phy_set_speed(ethqos->serdes_phy, speed); + if (ret == 0) + ethqos->serdes_speed = speed; + } + + return ret; } static int ethqos_clks_config(void *priv, bool enabled) -- 2.47.3