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 22CC2214812; Mon, 23 Feb 2026 09:35:07 +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=1771839308; cv=none; b=BospDogwZ9Fg8rXEAC9nOjAaKWBKph8vmu9Lb06Dh+xk93RqZ28xLNzKftV7Hhl2W9sVfaPUKfOS8T48NnIla0TFM2SuUTp2AYyy/S3ZgugS3YSD5Zqd369LDHpYYdquGlOmFAY5LRTTnnUB3RbfIEH9dIJUMJRIL0z8hG3HdC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771839308; c=relaxed/simple; bh=Y/PQEtciQwvgrASiufKuaUm8A6QNDh57jFnjPsT7a9c=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=e8wDbde1wDO+HbCXSfvqpOOaxBaEpk+GwUXRBPWGSjXGoH+AlRWrAkP1IaofdKRhC/oHyId1fVz+MBwYN5R0Y8Qk1WQbxK9Pdloo0QmZ5Xpoy01lA511Qj79qQi/WsF2KjU/TDbatYfsPoQ4cFCif4pqqM5tcXbjaN1YjJyu3Wg= 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=RK/nXdfX; 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="RK/nXdfX" 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=wcOiLZinkufcHuw/tuHyonj7h2JvDwTX8cEgQ3EA+7M=; b=RK/nXdfXjjAn9o13suE3Hnngw4 GCZ7Q6AYPwMS6+AIyNp/X4IAYODh9MTw2TgU7O8aTXj6kWbOdhqqpnH5mFsaPDjf/ht1g0XCLmZnS logsh6fIb4kc2Xo2mUNEWS8SH5KZcHKD3TGt+7sjXuzY6fx0bahhTVVFjvo+pPsguC3PlarDlZjar LxkGf3NhBDAiY7JJdfSAV16SNd3wyYpfk9Gaq6TsGuBnQ0qt211UFX99jtqjPB0OFlQ58tPxt08KQ GzNQdXHVpYjB9/J4XuH/+yMdH3/4xFyRg1OxbivW4E3cjjahD74A9I6AqSjcclrmqcRwVT5DkQ/AT 2rv+xxsQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:52938 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 1vuSKt-000000003nD-2pqT; Mon, 23 Feb 2026 09:34:40 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vuSKq-0000000AScA-1Wh3; Mon, 23 Feb 2026 09:34:36 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Frank Li , imx@lists.linux.dev, Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Chevallier , Mohd Ayaan Anwar , netdev@vger.kernel.org, Paolo Abeni , Pengutronix Kernel Team , Sascha Hauer , Vinod Koul Subject: [PATCH net-next 05/10] net: stmmac: qcom-ethqos: move loopback disable to .mac_finish() 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: Mon, 23 Feb 2026 09:34:36 +0000 Loopback is enabled to allow the dwmac soft reset to succeed. This is enabled when clocks are enabled in ethqos_clks_config(), which happens at driver probe and runtime PM resume - e.g. when the network device is administratively brought up. Currently, the loopback is disabled when the link comes up (via .mac_link_up() calling this driver's .fix_mac_speed().) Move the qcom_ethqos_set_sgmii_loopback() call which disables loopback from ethqos_fix_mac_speed() into ethqos' SerDes specific .mac_finish() method so that loopback is disabled a little earlier after reset has completed, and dwmac setup has completed. Reviewed-by: Mohd Ayaan Anwar Tested-by: Mohd Ayaan Anwar Signed-off-by: Russell King (Oracle) --- .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 964eca46a653..bd5d3bf90400 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -647,7 +647,6 @@ static void ethqos_fix_mac_speed(void *priv, int speed, unsigned int mode) { struct qcom_ethqos *ethqos = priv; - qcom_ethqos_set_sgmii_loopback(ethqos, false); ethqos_update_link_clk(ethqos, speed); ethqos_configure(ethqos, speed); } @@ -684,6 +683,17 @@ static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *priv) phy_exit(ethqos->serdes_phy); } +static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv, + unsigned int mode, + phy_interface_t interface) +{ + struct qcom_ethqos *ethqos = priv; + + qcom_ethqos_set_sgmii_loopback(ethqos, false); + + return 0; +} + static int ethqos_clks_config(void *priv, bool enabled) { struct qcom_ethqos *ethqos = priv; @@ -770,6 +780,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) case PHY_INTERFACE_MODE_2500BASEX: case PHY_INTERFACE_MODE_SGMII: ethqos->configure_func = ethqos_configure_sgmii; + plat_dat->mac_finish = ethqos_mac_finish_serdes; break; default: dev_err(dev, "Unsupported phy mode %s\n", -- 2.47.3