🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20885

Re: [PATCH net-next v7 5/7] net: ftgmac100: Require phy-mode for AST2700

#20885
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 10:13
160 lines
13912 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 2 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The new AST2700 phy-mode check in ftgmac100_mii_probe()
  (drivers/net/ethernet/faraday/ftgmac100.c, lines 1529-1533) can never…
- [Medium] The commit message says "The driver currently defaults to
  RGMII when the phy-mode property is missing" and describes the patch…
- [Medium] One AST2700 configuration can still probe without phy-mode: a
  node with an 'mdio' child but no 'phy-handle', 'fixed-link' or 'use-…
- [Low] The comment above of_get_phy_mode() in ftgmac100_mii_probe()
  (line 1527) still says "Default to RGMII.

--

net: ftgmac100: Require phy-mode for AST2700

This commit makes phy-mode a required property for AST2700. When
of_get_phy_mode() fails in ftgmac100_mii_probe(), probe now returns
-EINVAL for that SoC instead of falling back to RGMII.

> The driver currently defaults to RGMII when the "phy-mode" property
> is missing from the device tree. This default is no longer valid for
> AST2700, which also supports RMII via FTGMAC100_QUIRK_RMII_ENABLE.

[Severity: Medium]
Is this description accurate for AST2700? No AST2700 probe path seems to
reach the RGMII default.

With use-ncsi, ftgmac100_probe_ncsi() connects with
PHY_INTERFACE_MODE_RMII and never reads phy-mode.

With phy-handle or fixed-link, of_phy_get_and_connect() already fails
when phy-mode is missing:

	ret = of_get_phy_mode(np, &iface);
	if (ret)
		return NULL;

With the legacy MDIO scan, ftgmac100_mii_probe() returns -ENODEV on the
NULL mii_bus before it reads phy-mode.

The RGMII fallback only applies to FARADAY, AST2400 and AST2500. Could the
commit message say that this patch does not change AST2700 behaviour? As
written, it suggests a silent RGMII default on AST2700 has been fixed.

> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 9b7becb017262..5a578a62df673 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -1526,8 +1526,13 @@ static int ftgmac100_mii_probe(struct net_device *netdev)
>  
>  	/* Default to RGMII. It's a gigabit part after all */

[Severity: Low]
This isn't a bug, but this comment no longer matches the code. On
FTGMAC100_AST2700 a missing phy-mode now returns -EINVAL instead of
defaulting to RGMII.

>  	err = of_get_phy_mode(np, &phy_intf);
> -	if (err)
> +	if (err) {
> +		if (priv->mac_id == FTGMAC100_AST2700) {
> +			dev_err(priv->dev, "phy-mode is required for this SoC\n");
> +			return -EINVAL;
> +		}

[Severity: High]
Can this check ever run on AST2700? Before it reaches of_get_phy_mode(),
ftgmac100_mii_probe() checks priv->mii_bus:

	if (!priv->mii_bus) {
		dev_err(priv->dev, "No MDIO bus available\n");
		return -ENODEV;
	}

priv->mii_bus is only assigned in ftgmac100_setup_mdio(). ftgmac100_probe()
only calls that for the older MACs:

	if (priv->mac_id == FTGMAC100_FARADAY ||
	    priv->mac_id == FTGMAC100_AST2400 ||
	    priv->mac_id == FTGMAC100_AST2500) {
		err = ftgmac100_setup_mdio(netdev);

priv comes zeroed from devm_alloc_etherdev(), so priv->mii_bus is always
NULL on AST2700. ftgmac100_mii_probe() therefore returns -ENODEV before the
new FTGMAC100_AST2700 test.

Here is what ftgmac100_probe_dt() does for an AST2700 node without
phy-mode:

  use-ncsi: ftgmac100_probe_ncsi() hardcodes RMII, which the binding
  allows.

  phy-handle or fixed-link: of_phy_get_and_connect() already returns NULL,
  so probe fails with "Failed to connect to phy" with or without this
  patch.

  mdio child, no phy-handle: ftgmac100_mii_probe() is skipped and
  ftgmac100_probe_dt() returns 0 without checking phy-mode.

  no mdio child, no phy-handle: ftgmac100_mii_probe() fails with "No MDIO
  bus available" before the new check.

This patch changes the result of none of these paths. The check is still
unreachable, and unchanged, at the end of the series in "net: ftgmac100:
Allow building on ARM64".

Also, "dt-bindings: net: ftgmac100: Add AST2700 compatible" justifies its
oneOf(phy-mode, use-ncsi) rule by pointing to "ftgmac100_mii_probe(), where
the AST2700 phy-mode check lives".

Would this check work better in ftgmac100_probe_dt(), after the use-ncsi
branch and before the fixed-link/phy-handle/mdio split?

[Severity: Medium]
Related to the above: an AST2700 node with an mdio child node but no
phy-handle, fixed-link or use-ncsi still probes without phy-mode.

ftgmac100_probe_dt() {
	...
	if (!ftgmac100_has_child_node(np, "mdio")) {
		...
		err = ftgmac100_mii_probe(netdev);
		...
	}

	return 0;
}

The device then registers with netdev->phydev == NULL. On open, would
ftgmac100_reset_and_config_mac() dereference a NULL phydev here for any
is_aspeed device?

	if (priv->is_aspeed && priv->netdev->phydev->interface == PHY_INTERFACE_MODE_RMII) {

ftgmac100_start_hw() makes a similar read for the RMII quirk added in
"net: ftgmac100: Enable AST2700 RMII support". That commit says
"ftgmac100_probe_dt() always attaches a phy_device", which does not seem to
hold for this path.

The NULL phydev read on open can also be reached on AST2600 with the same
DT layout. For AST2700, moving the phy-mode check into ftgmac100_probe_dt()
right after the use-ncsi branch would cover this case.

>  		phy_intf = PHY_INTERFACE_MODE_RGMII;
> +	}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-support_ast2700-v7-0-33c8ca2d0dd7%40aspeedtech.com
Technical Details
Message-ID: <179542879858.3135.15143972557396175443@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369235-linux-kernel-netdev=dewy.ru
References: <20261119-support_ast2700-v7-5-33c8ca2d0dd7@aspeedtech.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369235-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v7 5/7] net: ftgmac100: Require phy-mode for AST2700
Date: Mon, 23 Nov 2026 10:13:18 +0000
Organization: Usenet Network
Message-ID: <179542879858.3135.15143972557396175443@kernel.org>
References: <20261119-support_ast2700-v7-5-33c8ca2d0dd7@aspeedtech.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3849343"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ys30sqku57ntepCbV+e9Jfn+GPs= sha256:eBcw2rTsQYcvOKGYqd4UxhvW3QXCSLpCPRepPvZuyFQ=
	sha1:egLJ4jj2yQva3/w4mJ7W3g2SnZA= sha256:p5+bZwFpAtOhCLEWMzmr0dWo6eYQlQWSSUw017C+zNk=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B5298125D98; Mon, 23 Nov 2026 13:14:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.3
X-Spam-Status: No, score=-2.3 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001,
	DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GFelV1C-Y2zm;
	Mon, 23 Nov 2026 13:14:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369235-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C8072125D99; Mon, 23 Nov 2026 13:14:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3DD43357F9; Mon, 23 Nov 2026 10:13:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795428806;
	b=Rmb42bKd9hD7w8UWJZs1C+UXsYTVxQ+IY+r4kEsgBzf0YWtAZ0Yqg48Xqd23gBWP+Llh
	 NVr5pZZQZ203KUJ3bi10NTZziHF58rxL1QklfWhBJ3c423OUnNhyNqIvx3o7YnnaI2hV6
	 VYezKL52aK0N4cI69E4+xhdNru3k1D2JcBDRrlUX7xJF8GOgALbo3HtF5bJKfEfrj4i6/
	 LF5vDYM3GCkWbo7SPb+FHDgP2majePbbbMc8l/YSXUGX9B/n0r6o/cZH9fKAJQNko3iTl
	 NwHkoAFWM8HWTsiM2JcJw25rGCfxSDedpYsmevpL1U5FSIqvJnJcZQXJF4QDrTOBkxg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795428806;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=lyb37VHY3Cz0Xe1qCFGWBdDx+Gpu8rjZZrsCih1gYKE=;
	b=HZv//nXQGEr59S5I61DIM4CdxUU9L6uPcWqog9KTRStRDDEhH0vK4Up8vYjzPjz2xlKO
	 fhNWSeID2dzpYRAtZOhWZ+82ZTSFp1Eud/SKq9/wAErxjZluCbt5trcCqJtHaTlPjwlfH
	 2ZX0wpXKlDPq0uCeIUNmdT4CD9x+wB/m8yHCT8GttgBkExhPfpdg4v1gRWpFzdRjXV6xX
	 6XIjWpVzRuHrQC/9KroRQJ8W+OLomkfLs+0Ape2bQUBRiV/15KGNVg7eElOyFFVlDI0fh
	 C9i0SjB6BFld4An0/U5TVXHWxDNGFBHS+uixWGS2jYIUOPHKxsF99n9q+Yp/fdpZt+Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="n5w/vE7m";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D52A606A687;
	Mon, 23 Nov 2026 10:13:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n5w/vE7m
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795428800;
	b=QNkLDF+bMJdkz0IRLsZNlGMvKxR3J624tA56TyR/Uile7mkW1Ag4InPZHcSB7aav33jT
	 FdT98yPLMU6E5Xp3pNWAQ6/1Fjycd76WN+XTIJtKskc6zP08QZrb2ONjAKwHjhM8fxWGp
	 UoxbXfMYjNGslGEKpmU/m14iMIaT3PdsTr7Kd+iCFlNHlRJh1ENc+FNf3O+Hs9qasvkh5
	 cfmXxx8P1voqLfb+xCO6YWV/oot8PT2nV3L3Vh9dTY3MEqzy5sZxYoaSUR9WrR3m4rngR
	 5eChBPHRBPspmneiooXph0pPJczUqEj+uQ9jEbsYr48gGwJmyrlKdGo9yvLWP5Y9kwA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795428800;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=lyb37VHY3Cz0Xe1qCFGWBdDx+Gpu8rjZZrsCih1gYKE=;
	b=K5iGGzoy0woEaEtyQfHynYCX+6QKZ9Z7XZVfoTFo1+Az00wxJERqmTVOkqZwCgCNLwWf
	 6Odkcwd3AfxTOv6GEO7Cn/7oPE6p9dYuL6diXMHXV1cRmw6vC5UuFzHaNmVvxAo/wFOzJ
	 UdNBbLfumu4Qt60F3jpFuOpa335sIoArLxlNRiyua1+XQit/P9FodkWXSaXqRdNcvK/1A
	 CeKDZ03bxEi/uXgbBuBQ2I0prt/ksLdHeFQzSZXfRwHI60UEPLKsa6layRjT5UL0TMF1y
	 A8yplhunrBPhnLp/TgyXCxa3aWEwFg5ClCf80GGgYBRJdknlXQYQTHWb6TN5uws8AHA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="n5w/vE7m";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D255606A69E;
	Mon, 23 Nov 2026 10:13:20 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 080571F000D4;
	Mon, 23 Nov 2026 10:13:18 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795428799;
	bh=lyb37VHY3Cz0Xe1qCFGWBdDx+Gpu8rjZZrsCih1gYKE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=n5w/vE7m+gYv6JZcG/Zbjgr9P4R1G4Ww2IbRzZaGir/wA9LvLBstljTkaH4ggozfq
	 vE3U+r4IKeVVgz+blyoW4YtYqHVZwAAo4Ltxb60gasobFcveT7IzP1ojnRMHVm57oD
	 nBGNE1kAA9DWYHH6/untuMG1YYFcmrza0unqgc6nYFZRFi1fCYQD8r7eUwkHwt26N4
	 QGc13hLj4EwwLnUo8SOTciLEWR2gQTAdeNQq9gZ/ShENKTojQLUjhuo2ibuyz680Hc
	 9AgTifw8fPf0AQdeYqHN+gEJnz1NZI4FGBOab2cbOJgn+3TVmSQz77AsQCjPYFNwMl
	 +znmeqmYxMBEg==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
 pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
 ratbert@faraday-tech.com, edumazet@kernel.org, hkallweit1@gmail.com,
 linux@armlinux.org.uk, netdev@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, andrew@lunn.ch
X-In-Reply-To: <20261119-support_ast2700-v7-5-33c8ca2d0dd7@aspeedtech.com>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list