From nobody Sun Feb 8 23:04:13 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (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 A4CA03376AC; Fri, 16 Jan 2026 02:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529407; cv=none; b=Crkb/pQ3LfTTJCr+4pv/gMpicNEUJyLQMXp/z0+gZoYm7+ZJC5R280SP4rHjmrAjGGFC4ctGLzEDgrKfRcvyEc42PgD/ozZAqzb7540yEMfkX+sjRi7/wHdFPcrV4h+Dgu0fyAEMF9PBQjUlfKRmcWK0yv/eBSnxMoRqryg1YY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529407; c=relaxed/simple; bh=8ZKQRYwxqb4uYhpPL+/18dXxqFZ15mvf3pgcRd+jy+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=GY3ZhCVdhnoOLxKz25WwryCk8/Wr98E0xSJ4VRk7nhb2oJE12Nx3RvWLN3w6gGb+hA7uQij6WjM0MOX1ClTvHbDxeCi1KH/h5EYevkkuRe0R9K1SyUjQARAit91cuMsDLuN2cz9uEopC1BhIiu6zUICMGGP/xYhZyCLLitMbhQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:20 +0800 Subject: [PATCH net-next v2 09/15] net: ftgmac100: Always register the MDIO bus when it exists Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-9-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=2265; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=3PMubt3+ZvyhKE+J/WvKsCqfbMgClicHATDmtsAfaJM=; b=Y38++rgU7d5R+MLPLp97cyO4maqXyZClX/c8MDB5KhX2H0ZbM99gc+9tHCWvz0o5F4zXMH/jS YW2buwKj4C9ADrkz6UAvoGkejzRktwArt5c9nn4orQFUk8sGK5/PMDv X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Both the Aspeed 2400 and 2500 and the original faraday version of the MAC have MDIO bus controllers as part of the MAC. Since it exists, always registering it makes the code simpler, and causes no harm. If there is no mdio node in device tree, of_mdiobus_register() will fall back to mdiobus_register(), making it safe. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index f1cb5dc37919..931fdf3d07d1 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1957,6 +1957,14 @@ static int ftgmac100_probe(struct platform_device *p= dev) priv->txdes0_edotr_mask =3D BIT(15); } =20 + if (priv->mac_id =3D=3D FTGMAC100_FARADAY || + priv->mac_id =3D=3D FTGMAC100_AST2400 || + priv->mac_id =3D=3D FTGMAC100_AST2500) { + err =3D ftgmac100_setup_mdio(netdev); + if (err) + goto err_phy_connect; + } + if (np && of_get_property(np, "use-ncsi", NULL)) { err =3D ftgmac100_probe_ncsi(netdev, priv, pdev); if (err) @@ -1965,18 +1973,6 @@ static int ftgmac100_probe(struct platform_device *p= dev) of_get_property(np, "phy-handle", NULL))) { struct phy_device *phy; =20 - /* Support "mdio"/"phy" child nodes for ast2400/2500 with - * an embedded MDIO controller. Automatically scan the DTS for - * available PHYs and register them. - */ - if (of_get_property(np, "phy-handle", NULL) && - (priv->mac_id =3D=3D FTGMAC100_AST2400 || - priv->mac_id =3D=3D FTGMAC100_AST2500)) { - err =3D ftgmac100_setup_mdio(netdev); - if (err) - goto err_setup_mdio; - } - phy =3D of_phy_get_and_connect(priv->netdev, np, &ftgmac100_adjust_link); if (!phy) { @@ -1999,9 +1995,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) * PHYs. */ priv->use_ncsi =3D false; - err =3D ftgmac100_setup_mdio(netdev); - if (err) - goto err_setup_mdio; =20 err =3D ftgmac100_mii_probe(netdev); if (err) { --=20 2.34.1