Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mmyangfl@gmail.com
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
Subject: Re: [PATCH net-next v3 3/5] net: hix5hd2_gmac: Use mdio child node for MDIO bus if it exists
Date: Wed, 25 Nov 2026 00:28:17 +0000	[thread overview]
Message-ID: <179556649734.3135.14403923700572284098@kernel.org> (raw)
In-Reply-To: <20261124002442.19414-4-mmyangfl@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

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

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] In hix5hd2_dev_probe()
  (drivers/net/ethernet/hisilicon/hix5hd2_gmac.c), the patch finds the…

--

net: hix5hd2_gmac: Use mdio child node for MDIO bus if it exists

This commit makes hix5hd2_dev_probe() look for an "mdio" child of the MAC
node. If one exists, the MDIO bus is registered against that child instead
of the MAC node itself, following the earlier macb change.

> diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
> index d129aeceb641e..a176870079e96 100644
> --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
> +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c

[ ... ]

> @@ -1189,7 +1190,9 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
>  	snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
>  	priv->bus = bus;
>  
> -	ret = devm_of_mdiobus_register(dev, bus, node);
> +	mdio_np = of_get_child_by_name(node, "mdio");
> +	ret = devm_of_mdiobus_register(dev, bus, mdio_np ?: node);
> +	of_node_put(mdio_np);
>  	if (ret)
>  		goto out_disable_clk;

[Severity: Medium]
What happens here when the mdio child exists but has status = "disabled"?

of_get_child_by_name() ignores the status property. In that case mdio_np
is non-NULL and the disabled node is passed to devm_of_mdiobus_register().
__of_mdiobus_register() then rejects it:

drivers/net/mdio/of_mdio.c:__of_mdiobus_register() {
    ...
	/* Do not continue if the node is disabled */
	if (!of_device_is_available(np))
		return -ENODEV;
    ...
}

The -ENODEV goes back through the goto out_disable_clk path, and the whole
Ethernet device fails to probe.

Before this patch the MAC node was always passed in. Its child scan uses
for_each_available_child_of_node(), so a disabled child was just skipped.

The same lookup is still there at the end of the series. After "net:
hix5hd2_gmac: Support fixed-link", any non-NULL mdio_np forces bus
registration:

	mdio_np = of_get_child_by_name(node, "mdio");
	if (mdio_np || priv->phy_node != node) {

So a fixed-link MAC with a disabled mdio child would also fail probe with
-ENODEV. That doesn't match the binding text "With a fixed link, the MDIO
bus is not registered unless this node is present."

Would of_get_available_child_by_name() work better here? Other net drivers
such as rzn1_a5psw, owl-emac, ibm emac and mtk_star_emac use it for the
same lookup, and it would treat a disabled mdio child as absent.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124002442.19414-1-mmyangfl%40gmail.com

  reply	other threads:[~2026-11-25  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  0:24 [PATCH net-next v3 0/5] net: hix5hd2_gmac: Support fixed-link David Yang
2026-11-24  0:24 ` [PATCH net-next v3 1/5] net: hix5hd2_gmac: Use devm_ managed netdev and MDIO bus David Yang
2026-11-25  0:28   ` netdev-bot+sashiko
2026-11-24  0:24 ` [PATCH net-next v3 2/5] dt-bindings: net: hisilicon,hisi-gmac-v1: Add mdio bus child node David Yang
2026-11-24  0:24 ` [PATCH net-next v3 3/5] net: hix5hd2_gmac: Use mdio child node for MDIO bus if it exists David Yang
2026-11-25  0:28   ` netdev-bot+sashiko [this message]
2026-11-24  0:24 ` [PATCH net-next v3 4/5] dt-bindings: net: hisilicon,hisi-gmac-v1: Allow fixed-link David Yang
2026-11-25  0:28   ` netdev-bot+sashiko
2026-11-24  0:24 ` [PATCH net-next v3 5/5] net: hix5hd2_gmac: Support fixed-link David Yang
2026-11-25  0:28   ` 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=179556649734.3135.14403923700572284098@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    /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