Article View: linux.kernel.netdev
Article #22211Re: [PATCH net-next v3 3/5] net: hix5hd2_gmac: Use mdio child node for MDIO bus if it exists
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 00:28
Date: Wed, 25 Nov 2026 00:28
79 lines
10858 bytes
10858 bytes
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
Technical Details
Message-ID:
<179556649734.3135.14403923700572284098@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-370921-linux-kernel-netdev=dewy.ruReferences:
<20261124002442.19414-4-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-370921-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179556649734.3135.14403923700572284098@kernel.org> References: <20261124002442.19414-4-mmyangfl@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="72751"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BibsO7HewE0e4wRB2FVMxZN/quw= sha256:a7k/1lTgPjhIMjINBOmuB7EoOknxhH4Rb5aMX/iuoH8= sha1:jLm3ucGccpEkN+Y6/a9UYJ3ZKgw= sha256:i7Y7/SSFWDMDRJUK7LrwWE4TXQ2qnCrPClFDphodRHc= 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 AEC7C125E38; Wed, 25 Nov 2026 03:28:41 +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 hcIEgWOzyA3w; Wed, 25 Nov 2026 03:28:33 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370921-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 84BF7125E2F; Wed, 25 Nov 2026 03:28:22 +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 D0DFD2EA6D; Wed, 25 Nov 2026 00:28:19 +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=1795566499; b=dmb7P9jcs0XGbjnIEFd7dUjCTlF0emBBde+ABKQio9FmGqtDgH9qvMyJiobE3FZVvMiC vjjfYwhmHe3DZalgFle5RCXLQVUgYv8m0H6nt7wAmYhqc5ujagHcugpEIMoT4rzmVo13C 5v/g456AdrkSOA/KWxr6r5uuY8BnKkvwnC0Klfjn4bOmqZTbQaQIZEJrHyOFxTpZa5Nu8 JwQ5Kob5QH/Cn4qP0Uq0sMsm+montYW3CLoddjmLNvI96rXcVpfWdfmDVb+Pt7yU8jHQQ G0YO1yyvi8olmM3SttPKiYXfAEgoHiNSjRRXUq7qSsno33TWyOoeg6yX+qrL5PkDopQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795566499; 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=5a10cI1NNFwvgv0ajxBZX9RkTJkKO0tcJCd7rfmnHMM=; b=YAqGFLiocK2scqhpeQ7L09HPsMaI8O1SQSvsFTxn708h1JsnUqvpdvuZmJzpkj8O2V4l BymPxeFFIi9CZozPlBnksV2ex47gdYa/XyFYrBD3szD2387AyZSRhMhEk9bRiiwne9woY +ioNVptmr+mBDVT+XtlC2vrDcynGW6naPobFliwsopFMsp5Dl7mqvnrcQMBW3eCz3/XCv wVuOtxHBwZlcFYpRiCXXek/Bu64wM50QA+XWfe46M+1Ip1YfvFoOT7mg5CfSYPdxzNOhk ngUScaveVQjNgWBYYRPVj5CICTAgaDkIVAsEmKzfbwaaA6cGwmO9P6pD3HtFkUPVWvQ== 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=knB6QgT4; 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 A7881606A32E; Wed, 25 Nov 2026 00:28:19 +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=knB6QgT4 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=1795566498; b=ycfPFSZzLfNFciXqkSKR64GrvigIW1AvpEyV/YiuMLjk7edpb9rCJ7RuZ8iMaq4U1s9D osFnLZ3oyZOFhak1bFpPfAtb52EGXwsziH/XBJP0A5Cc9HCC+D4Ey4dxVg2aOkBEMFf8Y b4TsExKNYt6s/ie7sMNpSvhaP6EIFhXXxoASO/nCXsQxRMsHrf67i3wfzsUtFyHg83E+i jWsA7OiFiUb2brG4MMaUfX9r+/HLOYkJ7T6to5kedGFxJlZIZpkm6yuXXZ/ri8nrGbqKv 0Z2skxj0OQVEFLzx2pnvsoJ3fMOMKFrWBUMPGnBf1TnhU4ebec37/w5fmoS37eLYUDA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795566498; 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=5a10cI1NNFwvgv0ajxBZX9RkTJkKO0tcJCd7rfmnHMM=; b=ZZetLd8cKc6RdaG1MPGcBTnxEAGeQd6hpQwTEQSTO5HQC9gppKjtz34skCYUD7DJI+v2 fuqcq+/MAPnJE2NDeTHbBG8cRiwguyUEGxM1vPRWre2H6LQ+Kk2v1EkDbVmsETMnfhgP/ AHxF7NuNnRDBgMT47Eov1yyLhWPlnqS4KfiU8msU20e10LBlQjPdsPfxiCy5Ueh7QMKfT CT3IX3gPsr8pzzDFQ1t4Sr8Aj6tAaw5iFA9UN/KpLmjQbci5kD+2UMacMoljcS7vQGNIi dGl093Y1QALXC8RBTBG3QiM4VbkIAHnroNUrWqgzeY3HEKUbHZGRSbmEBkkvraM4vhw== 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=knB6QgT4; 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 C3E09606A323; Wed, 25 Nov 2026 00:28:18 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C05C81F000C6; Wed, 25 Nov 2026 00:28:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795566498; bh=5a10cI1NNFwvgv0ajxBZX9RkTJkKO0tcJCd7rfmnHMM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=knB6QgT4a1UZ0lm/BWaHGvQeRHbHE/envNasEl94wwCI9cA6HF4Wfa2l3x+ou8gaS scckdpSImxoAi/FbBzOzmGYcVu2qrNUpPq+6R/w6xRoagvqBeLUp/N2xUD8nrgHLNd 8rXk7j7JVAmzM6gRtptuXpjilJbyGfPwkybG3Av3tC+J0rloZDHQhlEYMYHvYN01Gp QbkSM/7sLVIh+T0/x2dvyIaeCPMIEZvVFlJ30REfLu30ypl/8NjwQEczswll0Lh7mQ 4gdudGFq1ggcOHAOiSB2xnA14YBAYlGkZ9q1QQFSShJzCiU4BEqEhW8R/q3XOvL06S WaNIxs/TtOXPQ== 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-4-mmyangfl@gmail.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