Article View: linux.kernel.netdev
Article #22212Re: [PATCH net-next v3 5/5] net: hix5hd2_gmac: Support fixed-link
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 00:28
Date: Wed, 25 Nov 2026 00:28
139 lines
12796 bytes
12796 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] hix5hd2_dev_probe()
(drivers/net/ethernet/hisilicon/hix5hd2_gmac.c) now uses…
- [Low] The series' binding text (hisilicon,hisi-gmac-v1.yaml, `mdio`
description) says: "With a fixed link, the MDIO bus is not registered…
--
net: hix5hd2_gmac: Support fixed-link
When the MAC node has no phy-handle but of_phy_is_fixed_link() returns
true, this commit registers a fixed PHY from the MAC DT node. For a fixed
link, MDIO bus registration is skipped unless an mdio child node is
present. phy-handle takes precedence over managed = "in-band-status".
> diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
> index a176870079e96..b787b7777e924 100644
> --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
> +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
> @@ -1176,37 +1176,52 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
> hix5hd2_phy_reset(priv);
> }
>
> - bus = devm_mdiobus_alloc(dev);
> - if (bus == NULL) {
> - ret = -ENOMEM;
> + priv->phy_node = of_parse_phandle(node, "phy-handle", 0);
> +
> + /* In the case of a fixed PHY, the DT node associated
> + * to the PHY is the Ethernet MAC DT node.
> + */
> + if (!priv->phy_node && of_phy_is_fixed_link(node)) {
> + ret = of_phy_register_fixed_link(node);
> + if (ret < 0)
> + goto out_disable_clk;
> + priv->phy_node = of_node_get(node);
> + } else if (!priv->phy_node) {
> + netdev_err(ndev, "not find phy-handle\n");
> + ret = -EINVAL;
> goto out_disable_clk;
> }
[Severity: Low]
Is this condition broader than intended? of_phy_is_fixed_link() also
returns true for any managed value other than "auto":
drivers/net/mdio/of_mdio.c:of_phy_is_fixed_link() {
...
err = of_property_read_string(np, "managed", &managed);
if (err == 0 && strcmp(managed, "auto") != 0)
return true;
...
}
Before this patch, a MAC node with managed = "in-band-status" and no
phy-handle failed probe with "not find phy-handle". Now it probes and goes
through of_phy_register_fixed_link(), which checks in-band-status first:
drivers/net/mdio/of_mdio.c:of_phy_register_fixed_link() {
...
if (of_property_read_string(np, "managed", &managed) == 0 &&
strcmp(managed, "in-band-status") == 0) {
/* status is zeroed, namely its .link member */
goto register_phy;
}
...
}
That registers a fixed PHY with link=0. It also skips any fixed-link
subnode, so the speed and duplex given there are ignored.
hix5hd2 is a plain phylib MAC. It connects with of_phy_connect() in
hix5hd2_net_open(), and hix5hd2_adjust_link() is the only place that
programs port speed and duplex. The driver has no in-band status reader
and never calls fixed_phy_set_link_update() or fixed_phy_change_carrier().
Would the link ever come up for such a node?
The binding in this series only exempts fixed-link from the phy-handle
requirement. The commit message only says phy-handle takes precedence
over in-band-status.
Should managed = "in-band-status" without a phy-handle be rejected here?
Another option is to check for a fixed-link description explicitly.
[ ... ]
> mdio_np = of_get_child_by_name(node, "mdio");
> - ret = devm_of_mdiobus_register(dev, bus, mdio_np ?: node);
> + if (mdio_np || priv->phy_node != node) {
> + bus = devm_mdiobus_alloc(dev);
[ ... ]
> + ret = devm_of_mdiobus_register(dev, bus, mdio_np ?: node);
> + if (ret) {
> + of_node_put(mdio_np);
> + goto out_phy_node;
> + }
> + }
[Severity: Low]
What happens with a MAC node that has both a phy-handle and a fixed-link
subnode, but no mdio child?
phy-handle takes precedence, so priv->phy_node points at the PHY node and
priv->phy_node != node is true. The bus is then registered on the MAC
node itself. __of_mdiobus_register() finds the fixed-link child, which has
no reg, and scans every address:
drivers/net/mdio/of_mdio.c:__of_mdiobus_register() {
...
/* be noisy to encourage people to set reg property */
dev_info(&mdio->dev, "scan phy %pOFn at address %i\n",
child, addr);
...
}
The fixed-link node has no compatible, so it counts as a PHY, and
of_mdiobus_register_phy() is tried on it at each free address. This
produces the "scan phy fixed-link at address X" output that the commit
message says this change avoids.
The binding text in this series says:
With a fixed link, the MDIO bus is not registered unless this node is
present.
The binding does not forbid combining phy-handle with fixed-link. Should
the binding description or this condition be changed so they agree for
this case?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124002442.19414-1-mmyangfl%40gmail.com
Technical Details
Message-ID:
<179556650026.3135.16586116032189589789@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370923-linux-kernel-netdev=dewy.ruReferences:
<20261124002442.19414-6-mmyangfl@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370923-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 5/5] net: hix5hd2_gmac: Support fixed-link Date: Wed, 25 Nov 2026 00:28:20 +0000 Organization: Usenet Network Message-ID: <179556650026.3135.16586116032189589789@kernel.org> References: <20261124002442.19414-6-mmyangfl@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="72801"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:iq2jOqSvcDkqIB20kDl6LHncGtU= sha256:10vDq7I/xwZC/By3VTkdK211uTwQbjVwi/os6k6GiOc= sha1:ql3/kVD31X6WPzC1+dS4LcteR5g= sha256:PfNIuhf6eEBcj+9d4XUONQAjaBfveMNqXBxDvVDBcKE= 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 45E9E125E2F; Wed, 25 Nov 2026 03:28:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, 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 IT5wybHOWuec; Wed, 25 Nov 2026 03:28:41 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370923-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 41AB8125E3A; Wed, 25 Nov 2026 03:28:32 +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 57A632E87D; Wed, 25 Nov 2026 00:28:28 +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=1795566507; b=GYccjSpeXCRugSkHyEg5OIpO+PrL+p3Y3K5H9KR8UqBMckoumDMisJ41vvfmoVHI5e8k KHlqKU+xn2eueYpN1H+3SfqUaLg0HrMR8KaQcYUAVSABcrcrPG0WJ9uTxlCyJM1+qVluk nAcpRo8cuboL3STDsaBDju15Z3JSDzuJcB5j4RefxuLjNFpDarRpq5XDrefXOPnjVw5Lp LaMhfAO746+tlbmBd8iG8RzVKHg6Dq9VkjGQG3DhVPxar3XxWO7SIPYFPfl2gF2+vfspn p8/5+bwnaNJUHXFQfCDGKzoDIotnORp/6kt80TPRwkWTWzl8pZ3jJSuhCwy+Yfu36uQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795566507; 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=0Ogcn6Yj5HjgRG7LSf4omg5LzaKmfYWDCA7gXIBMrao=; b=m+TB/fUjNnOK88zpuaHIFeduHmIih/3gMs69zqBrPGQycHvLF+Ujxljel1t7ar2dETrA eFfpS4filWa7qv/0Y2ts6DwACbmsppVAPypiJAMHDwPBeUIcg04iNCdtJvcNqwzhQBau5 Ovy69BJITPRT76sviGS5PlKf8xvOnqhL+Bez2JT1r/NllAaoXk22v4Fnz695vbVr9LVgE hgm8j24bFsBeO+Zd/VFhK6+q5juLRZIvK1ignEmC5EWTpMRad5MxKtbRlNgddQZ6UTI6Q 50Q3jhiQN2e7FiEgbpOCuCqDuuoxQPykb36sTtg4ITPClhFB7SaEJRqInmXlvRRpaWw== 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=FdX7KFWk; 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 B27BF606A330; Wed, 25 Nov 2026 00:28:27 +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=FdX7KFWk 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=1795566501; b=KRYt+P9IbPHMn2nuTfHGYVqTeWebyxVE1L5TvCibgBXhGIRMMQDq0PID/RblksBiJE1X pWEGRums9aaNkIZqpQcdKm+IoDe056Eyis+Y7gbsDwNVHYVTL4PVWx4jCKtsXCuOaiOow vmf6Mh719QgIPU7/+PUBkLWXcWAgrI2uBYPezJ4HodQUaK94TD0BXZenUXPDbup7oilIm 41g6CeVcsHf0Tpf8p1wAkJdNZrMOgqaH1Bu+aCYFOoUoFvnUjqpanS9Rf+YTiC9xdVSw7 cfhCwvXiRcDnrqh2yv6pVcNRqo08xhUEsL6ivTc+Uc5y+rzW2DIMrfsFUge+un1TeOA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795566501; 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=0Ogcn6Yj5HjgRG7LSf4omg5LzaKmfYWDCA7gXIBMrao=; b=Ddf2RzmT199jTkTQW/GlmM8Th7FOIRIJB8wZYi9VeA4Es6oqXIPvyxq6JWoivndpjMub Z1xtKNJcrCi5i+R0v+6PKP/BFL48I4huQ2qPQ/UyLSDimO8M7JfVB4yGBn96l4AzhneAD UC7kkkNXTZREbvRzQ+PY/5ZY/k6dxiiVUre7iGrhWEeVwzy0OOJ8v6xu1CPGv9DBkx1Mj sezWnINE/fKgK9Ew1e8QKF4D9UddZ91Ui0GOH9tNOUVWUtaMykT4x4B+8WyjSATYqBpV1 WnmkrUTkm6jL+2dG9+un+FpLaw6IS41fm1UrfQ3JrNO2YI4u6KuBOpLi4fzIKaHcYZw== 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=FdX7KFWk; 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 CEED1606A335; Wed, 25 Nov 2026 00:28:21 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABE681F000C6; Wed, 25 Nov 2026 00:28:20 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795566501; bh=0Ogcn6Yj5HjgRG7LSf4omg5LzaKmfYWDCA7gXIBMrao=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FdX7KFWkdk6F3TEUkK51puLe42nJTvz8ze8Cw4uOcEn6+3T6teai6aklDGrDvmlhf JRlVKrGazV4ZMO/adLV8UBL51u98CZt5m5qbWlU+DTLCLhTj39JxvZDM4T90R4fR0u hvE6R6C8I+BfoIfmgAIikClNvwz93CY+6i1EC9HlSZo195Ad3oBMjUF1YTWxJtbLE8 qINMda980WwczCA4wyo7Bu99qT+0jP64Fe96A4xgDGip7zi2w0H8dyr+C/0igUbXgf K4AiKlNx3jv/7WOm3fjvFRBWbAv98q2kVMnB49kO2TPkHKEdk1midmGQbwmooqeLjh Kjs7PG2IPE2nw== X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shenjian15@huawei.com, shaojijie@huawei.com, devicetree@vger.kernel.org X-In-Reply-To: <20261124002442.19414-6-mmyangfl@gmail.com> X-sashiko-severity: Low 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