Article View: linux.kernel.netdev
Article #20882Re: [PATCH net-next v7 3/7] net: ftgmac100: Add AST2700 compatible support
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 10:13
Date: Mon, 23 Nov 2026 10:13
223 lines
15980 bytes
15980 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 (1) · Medium: 1 · Low: 2
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).
- [Medium] The binding and the driver disagree on how an AST2700 PHY is
wired up.
- [Low] At this revision AST2700 gets the 32-bit Aspeed handling and
nothing more.
- [Low] Several driver comments that list which Aspeed generations share
a behaviour were not updated when this patch put AST2700 in the…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but this patch
extends it to AST2700.
--
net: ftgmac100: Add AST2700 compatible support
This commit adds an FTGMAC100_AST2700 mac_id with matching match data,
and adds the "aspeed,ast2700-mac" compatible to the OF match table.
AST2700 gets the same Aspeed descriptor masks and is_aspeed handling
as AST2400/2500/2600.
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 6d2fe5c2f3903..67b1fa464a421 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -37,7 +37,8 @@ enum ftgmac100_mac_id {
> FTGMAC100_FARADAY = 1,
> FTGMAC100_AST2400,
> FTGMAC100_AST2500,
> - FTGMAC100_AST2600
> + FTGMAC100_AST2600,
> + FTGMAC100_AST2700
> };
[Severity: Low]
This isn't a bug, but FTGMAC100_AST2700 now sits in the same class as
AST2600. Should the comments that list the Aspeed generations be updated
to match?
The rclk field in struct ftgmac100 still says:
/* AST2500/AST2600 RMII ref clock gate */
struct clk *rclk;
is_aspeed is now set for AST2700, so ftgmac100_setup_clk() fetches RCLK
for AST2700 as well.
The comment in ftgmac100_probe_dt() ("2600 has an independent MDIO
controller, not part of the MAC") and the one in ftgmac100_setup_mdio()
("The AST2600 has a separate MDIO controller") also apply to AST2700 now,
but neither mentions it.
These comments are still unchanged at the end of the series.
[ ... ]
> @@ -2017,7 +2018,8 @@ static int ftgmac100_probe(struct platform_device *pdev)
>
> if (priv->mac_id == FTGMAC100_AST2400 ||
> priv->mac_id == FTGMAC100_AST2500 ||
> - priv->mac_id == FTGMAC100_AST2600) {
> + priv->mac_id == FTGMAC100_AST2600 ||
> + priv->mac_id == FTGMAC100_AST2700) {
> priv->rxdes0_edorr_mask = BIT(30);
> priv->txdes0_edotr_mask = BIT(30);
> priv->is_aspeed = true;
[Severity: High]
This is a pre-existing issue that was not introduced by this patch, but
setting is_aspeed for AST2700 carries it over to the new compatible.
ftgmac100_reset_and_config_mac() dereferences phydev without checking
for NULL:
if (priv->is_aspeed && priv->netdev->phydev->interface == PHY_INTERFACE_MODE_RMII) {
ftgmac100_probe_dt() can return 0 with no PHY attached. This happens
when the node has no use-ncsi, no fixed-link and no phy-handle, but does
have an mdio child:
if (!ftgmac100_has_child_node(np, "mdio")) {
...
err = ftgmac100_mii_probe(netdev);
...
}
return 0;
In that case register_netdev() succeeds with netdev->phydev == NULL, and
the first open runs:
ftgmac100_open()
ftgmac100_reset_and_config_mac()
priv->netdev->phydev->interface
ftgmac100_open(), ftgmac100_stop() and ftgmac100_phy_disconnect() all
check netdev->phydev for NULL already. So a NULL phydev after probe
seems to be an expected state.
The binding accepts such a node, since an mdio child is allowed and
phy-handle is optional.
Can this oops in ndo_open, with rtnl held, for an AST2700 node like this?
There is also a later patch in the series, "net: ftgmac100: Enable
AST2700 RMII support". It says that ftgmac100_probe_dt() always attaches
a phy_device before register_netdev() can succeed, and it adds another
unguarded phydev->interface dereference in ftgmac100_start_hw(). Does
that assumption still hold given the path above?
[ ... ]
> @@ -2131,6 +2133,10 @@ static const struct ftgmac100_match_data ftgmac100_match_data_ast2600 = {
> .mac_id = FTGMAC100_AST2600
> };
>
> +static const struct ftgmac100_match_data ftgmac100_match_data_ast2700 = {
> + .mac_id = FTGMAC100_AST2700
> +};
> +
[Severity: Low]
At this revision AST2700 only gets the 32-bit Aspeed handling. The
driver never calls dma_set_mask*(). ftgmac100_init_hw() writes only the
low 32 bits of the ring bases:
iowrite32(priv->rxdes_dma, priv->base + FTGMAC100_OFFSET_RXR_BADR);
ftgmac100_alloc_rx_buf() also keeps only the low 32 bits in the
descriptor:
rxdes->rxdes3 = cpu_to_le32(map);
AST2700 DRAM starts at 0x400000000 (memory@400000000 in
ast2700-evb.dts). Would the MAC be able to DMA at all on AST2700 at this
point in the series?
A later patch in the series, "net: ftgmac100: Add AST2700 upper DMA
address support", seems to fix this. It adds FTGMAC100_QUIRK_DMA_35BIT,
the 35-bit DMA mask, the high ring base registers and the descriptor
high address bits.
The Kconfig dependencies also prevent building the driver for arm64
until "net: ftgmac100: Allow building on ARM64":
depends on ARM || COMPILE_TEST
depends on !64BIT || BROKEN
So this state probably can't be reached on real hardware during
bisection. Would it still make sense to wire up the compatible after the
DMA support lands in the series?
> static const struct ftgmac100_match_data ftgmac100_match_data_faraday = {
> .mac_id = FTGMAC100_FARADAY
> };
> @@ -2142,6 +2148,8 @@ static const struct of_device_id ftgmac100_of_match[] = {
> .data = &ftgmac100_match_data_ast2500 },
> { .compatible = "aspeed,ast2600-mac",
> .data = &ftgmac100_match_data_ast2600 },
> + { .compatible = "aspeed,ast2700-mac",
> + .data = &ftgmac100_match_data_ast2700 },
[Severity: Medium]
Do the binding and the driver agree on how an AST2700 PHY gets
connected?
ftgmac100_probe() only calls ftgmac100_setup_mdio() for FARADAY, AST2400
and AST2500. For AST2700, priv->mii_bus is therefore always NULL:
if (priv->mac_id == FTGMAC100_FARADAY ||
priv->mac_id == FTGMAC100_AST2400 ||
priv->mac_id == FTGMAC100_AST2500) {
err = ftgmac100_setup_mdio(netdev);
This means a non-NC-SI AST2700 node only probes successfully if it has
phy-handle or fixed-link. Otherwise one of two things happens.
Without an mdio child, ftgmac100_probe_dt() calls ftgmac100_mii_probe(),
which always fails here:
if (!priv->mii_bus) {
dev_err(priv->dev, "No MDIO bus available\n");
return -ENODEV;
}
With an mdio child, ftgmac100_probe_dt() returns 0 with no PHY attached.
That leads to the NULL phydev dereference described above.
At the end of the series, faraday,ftgmac100.yaml only requires one of
phy-mode or use-ncsi for aspeed,ast2700-mac. It leaves phy-handle
optional and allows an mdio child. So a node such as
compatible = "aspeed,ast2700-mac"; phy-mode = "rgmii"; passes
dt_binding_check, but then either fails to probe or binds with no PHY.
The binding patch justifies the phy-mode requirement by pointing at the
AST2700 phy-mode check in ftgmac100_mii_probe(). That check is added by
"net: ftgmac100: Require phy-mode for AST2700", and it sits after the
!priv->mii_bus guard, which always returns -ENODEV for AST2700. Can that
check ever run?
On the phy-handle/fixed-link path, of_phy_get_and_connect() already
returns NULL when of_get_phy_mode() fails.
Should the binding require phy-handle or fixed-link for AST2700 when
use-ncsi is absent?
> { .compatible = "faraday,ftgmac100",
> .data = &ftgmac100_match_data_faraday },
> { }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-support_ast2700-v7-0-33c8ca2d0dd7%40aspeedtech.com
Technical Details
Message-ID:
<179542879503.3135.9192959618986539421@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369233-linux-kernel-netdev=dewy.ruReferences:
<20261119-support_ast2700-v7-3-33c8ca2d0dd7@aspeedtech.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369233-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v7 3/7] net: ftgmac100: Add AST2700 compatible support Date: Mon, 23 Nov 2026 10:13:15 +0000 Organization: Usenet Network Message-ID: <179542879503.3135.9192959618986539421@kernel.org> References: <20261119-support_ast2700-v7-3-33c8ca2d0dd7@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3849159"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:0iqvO5yF1BggMz01cfZQCvVqE6c= sha256:YdNjuHNEIkJ/IwrMd3qRUlEtvEu3OBCJeX9Ema0RRRM= sha1:LBIPYXaN9X3KZH/sDxbaaYxMBhM= sha256:5qau+n9+/+HqVxV0yVDH8xTB0SGOQrawUuTpCwB8kXE= 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 1D3A9125D9A; Mon, 23 Nov 2026 13:13:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[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] 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 R4uB8_Pohsby; Mon, 23 Nov 2026 13:13:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369233-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 21782125D99; Mon, 23 Nov 2026 13:13:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 1F2512CC98; Mon, 23 Nov 2026 10:13:26 +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=1795428802; b=1sGyms3WzUNd1X0d0DIB7JU4v5katDZe1CuLwyaqCyseYQ5i3qzl7eoMzxpM8n3sVpbK LFf2Ecm5KVEwA0rt/4JHN9LEX1b/1vw23OwOBIGYjMOibBDYOJo9X71oqxTeVjFxw5Q/m OCQlGQWTe76vPb4ikLyCKLLT7MxQdC9A/Covteq5N9U9dAwXPvMeXgYnVy8Wy1xrqL6t7 86AvNY/WQZcwe+DrTzpMtIUNzZ28aOb+xhM50tP3kR4Pkvbd1thktkG5HcRatJ55RsBBQ TJ9gSPmreOAoiGATp+0V1eHwf4z4PWtIMtEiImjNDDbnUi3NZDgJJ29zFNvV6hJL9AQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795428802; 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=+3u3YHjcbeHf6btn75vHawYuV1pEQVZUpBuy+G6atJk=; b=iOs/5bZ2llIoJnvXkdnZSOgZOMgIBeUf/FvkO/f/D5WJoJR+D2mT0SYPM2FDViwSCO1X FCdArYg7D9d1E2zP58JPN+lp3pHLM9gwex1OmtBReyoiuQvv7xir/sKF8ut+T32iOVq6o ADsHQ8m8ujclXEO6z83QP9KQ/tklF8n/g6/UwQi1rF5l9Sz17GRA9ZJISNuL5dBbBDWlI cMOCLwHa+kPL1R2j3gfDPowNykRcrfo/7rhPZQqHdmeQFii53CetP/uDPF7dV6cbWoW50 5RPpyxvAz7l8hBHET6B1GSogoTFYu0DrhCaY2n9DBvvaIfFtJj33MzQaXmFHitk35zw== 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=NSqXk3sg; 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 6B19D606A33A; Mon, 23 Nov 2026 10:13:22 +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=NSqXk3sg 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=1795428796; b=UtZLkQUOn/5YlQMqW28B+ofZ+BNTeZtppAV/K+jrFSH6cD/GBsxrRLugA8hG+dLvFqbd 1cffKQ0YnpfOOWtB8tOSRp3x5yt5Wi/bSRAU2Cz/fCkoL+aEGvQkzGzhp+jfX0AF626rG TSL5Jo/nFT5Q5Jat+X12oWeDiafYvHb3E1Z+lg+uBoySL8/QCdBL76J6bg29Gbwy4IelG HP26877eFzJLdSxX8vM6IIIuF1cVm1R+E/hhwAUDaqCPVec90zKQjxZJCywqL9tcKpjis igZdWOhaS4KavdJ89+quz4bwCaPZv4pHRuqZUnsFb+qmpXyvR7Ls4OhygGBO3sHqRag== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795428796; 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=+3u3YHjcbeHf6btn75vHawYuV1pEQVZUpBuy+G6atJk=; b=QtPxTx6DyPv+y9AO2zGayR58uxM6cLOGTTrTNCrAiT8heWYcwGVXUtbsgl5SE7b97Ro4 Fwzu+jkHEMuwS1h9oC8zMcWaL9EfxV/ap/28oOvaC/KNM8oIarbarBWdg1YESoTyiO5W+ J9YNWpexwesXDxJi+tmERn+hZA5xekTnvtS4cjaqPV+Kh4lwc7+XcKHeDYTLX+7tCM1k8 svy1k8HX8/RQf9wQpjT4F1Vr403V5vyVuytvAWng8xEEaTGI9do886FD0SzJuOH30MlDp 34dSQwC5om/NRz5XX7570FOyvuWilrdOGZ9FI5pJnovG+hEjEVQEqLcdt7+7uk9Po1g== 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=NSqXk3sg; 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 8BF85606A32E; Mon, 23 Nov 2026 10:13:16 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FEB01F000C4; Mon, 23 Nov 2026 10:13:15 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795428796; bh=+3u3YHjcbeHf6btn75vHawYuV1pEQVZUpBuy+G6atJk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NSqXk3sgW2FKATPeYI0L05/qAFaxApwBKGMW6WVWWbgJrtwpzyN/IY2+5qHUNSlIH ZvhmL+gzEUdA7HUYH3rdxTtY6XERpg4tPRh8V9hiSy6xet7r8Mu3cdl/WYYklhYosD mZFMc7x7qJHIcRWe5yZCMxWVITbJMkhIhYDDaOZg0LAn/dLKwQheH+xKCF4pIbEhzW JbSTh9RqroEO9E/X0Kgl4uvHwCudnhJJMRCMlTJ61nouS8CugTgfeUV+X7z7+D3G1t jdXSKbOB3njzhaEaGLSiBL4ev3bnC1au+g0NndgZazbqDy0fN0eVrSeStqx785pAXA nZzclL/JE/iuw== 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-3-33c8ca2d0dd7@aspeedtech.com> X-sashiko-severity: Medium 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 X-Received-Bytes: 15721