From: netdev-bot+sashiko@kernel.org
To: jacky_chou@aspeedtech.com
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
Subject: Re: [PATCH net-next v7 5/7] net: ftgmac100: Require phy-mode for AST2700
Date: Mon, 23 Nov 2026 10:13:18 +0000 [thread overview]
Message-ID: <179542879858.3135.15143972557396175443@kernel.org> (raw)
In-Reply-To: <20261119-support_ast2700-v7-5-33c8ca2d0dd7@aspeedtech.com>
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
next prev parent reply other threads:[~2026-11-23 10:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 9:32 [PATCH net-next v7 0/7] net: ftgmac100: Add AST2700 support Jacky Chou
2026-11-19 9:32 ` [PATCH net-next v7 1/7] dt-bindings: net: ftgmac100: Make Aspeed compatibles standalone Jacky Chou
2026-11-20 9:32 ` sashiko-bot
2026-11-23 10:13 ` netdev-bot+sashiko
2026-11-19 9:32 ` [PATCH net-next v7 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible Jacky Chou
2026-11-23 10:13 ` netdev-bot+sashiko
2026-11-19 9:32 ` [PATCH net-next v7 3/7] net: ftgmac100: Add AST2700 compatible support Jacky Chou
2026-11-20 9:32 ` sashiko-bot
2026-11-23 10:13 ` netdev-bot+sashiko
2026-11-19 9:32 ` [PATCH net-next v7 4/7] net: ftgmac100: Enable AST2700 RMII support Jacky Chou
2026-11-23 10:13 ` netdev-bot+sashiko
2026-11-19 9:32 ` [PATCH net-next v7 5/7] net: ftgmac100: Require phy-mode for AST2700 Jacky Chou
2026-11-20 9:33 ` sashiko-bot
2026-11-23 10:13 ` netdev-bot+sashiko [this message]
2026-11-19 9:32 ` [PATCH net-next v7 6/7] net: ftgmac100: Add AST2700 upper DMA address support Jacky Chou
2026-11-23 10:13 ` netdev-bot+sashiko
2026-11-19 9:32 ` [PATCH net-next v7 7/7] net: ftgmac100: Allow building on ARM64 Jacky Chou
2026-11-23 10:13 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179542879858.3135.15143972557396175443@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=jacky_chou@aspeedtech.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ratbert@faraday-tech.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox