Article View: linux.kernel.netdev
Article #27417Re: [PATCH net-next v5 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 16:03
Date: Sat, 05 Dec 2026 16:03
150 lines
14024 bytes
14024 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท 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] net: stmmac: dwmac-syna: legacy MDIO fallback bypasses shared
MDIO guard
- [Low] The new driver dwmac-syna.c adds a devicetree ABI that nothing in
the tree documents.
- [Low] The driver does more than the commit message and Kconfig help
describe, and the extra behaviour is not obvious.
--
net: stmmac: Add glue layer for Synaptics SL2610 SoC
This commit adds a dwmac glue driver for the DesignWare GMAC controllers
in the Synaptics SL2610 SoC. The driver gets a syscon regmap and a
per-MAC interface control register offset from the device tree. It uses
them to set the PHY interface and to select the master of the shared
MDIO bus.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
> new file mode 100644
> index 0000000000000..b2cb47c0d39e4
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-syna.c
[ ... ]
> +/* Only one MAC can provide the shared external MDIO bus. */
> +static unsigned long syna_mdio_claimed;
> +
> +static void syna_dwmac_release_mdio(void *data)
> +{
> + clear_bit(0, &syna_mdio_claimed);
> +}
> +
> +static int syna_dwmac_claim_mdio(struct syna_dwmac *dwmac)
> +{
> + if (!dwmac->plat->mdio_node ||
> + !of_device_is_available(dwmac->plat->mdio_node))
> + return 0;
> +
> + if (test_and_set_bit(0, &syna_mdio_claimed))
> + return dev_err_probe(dwmac->dev, -EINVAL,
> + "Shared MDIO bus already claimed\n");
[Severity: Medium]
Does this guard cover the case where stmmac falls back to the legacy
MDIO bus?
devm_stmmac_probe_config_dt() calls stmmac_mdio_setup(). When the MAC
node has no mdio child, no phy-handle and no fixed-link, legacy_mdio is
set and plat->mdio_bus_data is allocated, but plat->mdio_node stays
NULL.
In that case both syna_dwmac_claim_mdio() and syna_dwmac_init() return
0 early. syna_mdio_claimed is never set, and SYNA_MDIO_MASTER_SEL in
SYNA_TW_PORT_CTRL is never written. stmmac_mdio_register() only checks
plat->mdio_bus_data, though. It calls of_mdiobus_register() with a
NULL node, which registers and scans a live bus on that MAC.
Suppose MAC0 takes the legacy path. It scans the shared external MDIO
bus without claiming it. When MAC1 later probes with an available mdio
child, the claim succeeds and syna_dwmac_init() switches
SYNA_MDIO_MASTER_SEL to MAC1 underneath MAC0's registered bus. MAC0's
PHY accesses would then go out through the other MAC. If MAC1 takes
the legacy path instead, it scans the bus without selecting itself as
master at all.
If the legacy auto-probe isn't supported on SL2610, should the driver
clear plat->mdio_bus_data when there is no available mdio node? Or
should the claim and the master select key off plat->mdio_bus_data,
which is the condition stmmac_mdio_register() uses?
[Severity: Low]
The commit message only says this adds glue for the SL2610 GMACs. The
Kconfig help says "This configures the PHY interface through the system
controller." Could the changelog also describe the shared MDIO handling?
The two MACs appear to share one external MDIO bus. syna_dwmac_init()
picks the master by writing SYNA_MDIO_MASTER_SEL in SYNA_TW_PORT_CTRL,
and the value depends on which RGMIIx_CTRL offset the DT supplied.
syna_mdio_claimed is module-global. If a second MAC instance has an
available mdio child node, its whole probe fails here with -EINVAL. That
Ethernet port is then lost, not just its MDIO bus.
The syscon offset is only checked against SYNA_RGMII0_CTRL and
SYNA_RGMII1_CTRL on the MAC that owns the MDIO bus. On the other MAC,
syna_dwmac_set_phy_intf_sel() writes to whatever offset the DT provides,
with no check.
These rules decide how board DTs have to be written. Only one MAC may
carry an mdio child, and the other has to use a phy-handle into that
bus. Would it make sense to state them in the commit message, and to
explain there why the cross-instance global state is needed?
> +
> + return devm_add_action_or_reset(dwmac->dev, syna_dwmac_release_mdio, NULL);
> +}
[ ... ]
> + dwmac->regmap = syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node,
> + "syna,syscon", 1,
> + &dwmac->rgmii_ctl);
> + if (IS_ERR(dwmac->regmap))
> + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->regmap),
> + "Failed to get syscon regmap\n");
[ ... ]
> +static const struct of_device_id syna_dwmac_match[] = {
> + { .compatible = "syna,sl2610-dwmac" },
> + { /* sentinel */ }
> +};
[Severity: Low]
This adds the "syna,sl2610-dwmac" compatible. syna_dwmac_probe() also
requires the "syna,syscon" property: a phandle plus one argument cell,
which is used as the RGMIIx_CTRL offset. Is there a devicetree binding
for these?
I couldn't find a schema for syna,sl2610-dwmac under
Documentation/devicetree/bindings/net/, and snps,dwmac.yaml doesn't list
it. The only sl2610 bindings in the tree seem to be syna,sl2610-uart and
syna,sl2610-spi.
Without a binding, dtbs_check can't validate board DTs, and checkpatch
will warn about an undocumented compatible. Nothing states that the
syscon argument cell must be 0xa18 or 0xa3c, as syna_dwmac_init()
expects.
Should a binding patch be posted before or alongside this driver?
> +MODULE_DEVICE_TABLE(of, syna_dwmac_match);
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204152836.31432-1-jszhang%40kernel.org
Technical Details
Message-ID:
<179648662180.3146.5110527824140503520@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378040-linux-kernel-netdev=dewy.ruReferences:
<20261204152836.31432-3-jszhang@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378040-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 2/2] net: stmmac: Add glue layer for Synaptics SL2610 SoC Date: Sat, 05 Dec 2026 16:03:41 +0000 Organization: Usenet Network Message-ID: <179648662180.3146.5110527824140503520@kernel.org> References: <20261204152836.31432-3-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3063777"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:0mnkBpX4MCHWNj0iTURt+3OIp9g= sha256:EYyymrjhppw7zGTAxwc02ityL9wiEX59QGzenifLZvI= sha1:t2BPd6HbvifB9UIBEcQfvjfDRnw= sha256:Ay7POfCLqfhc6QI7A2ZrLgyJhnzjObkAmQh9r2XmaFs= 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 D6630117E02; Sat, 5 Dec 2026 19:04:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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 BRsF4KwdbAH1; Sat, 5 Dec 2026 19:04:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-378040-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 42219117E51; Sat, 5 Dec 2026 19:03:51 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 4D732298AA; Sat, 5 Dec 2026 16:03:49 +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=1796486624; b=xAM46Z+6WU6MoVbFo+0TE0AP44UCXniqPNUaPHNX08ylHLF21D9jCrnMMZNCfyisjUHu SdwyEtfB4L3Fiq78JGkS5LU/bRo9y7NGMINUvUqIlsiBUPX45B6pLs+RHyexNp+I5oTlp V7pSTfx5YLA4ZvMhMs/6B4nn/mOCqM98jLCibJX+YKFS0SR7xftIAIp98HipBSZiI81El xQcGo21XVv4tH3zcamVosKUPU2fuVjlyN515GAgEJMt2S8nWwDd1+OE394vAgS+BuotGa TFLEmAczRYM9DG09wq4oyy7sEhbijNqVMFGm3YXImqqNCADgu/tSu15aVNP3TSmbBNQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796486624; 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=B0pB0pcXmDNs/n8/oDlmXgKKJ175xy388bv4PeAraOc=; b=xdDkQqN0OtZ6/3UqVIEDPWQoykC7w7leeTLCLQwuCKMmiijWwuwM/473iuYDx3Txor2V 6QMAh1cy/OKB+zO+Vt/iVfgEptmhqGlSKVYjaLMTGeAVrj3ZXBgzNGKKJ5efe5z1/g+Of 62lxGR1B7q37L/XYucAsrq75ShqKWxDNSEHMpX0ouJBxJRBjV7WA1mrmexlEVk6rPGqpJ J1GlQSTRly3UIyHIRSYgpSHWZRp137PvoKAN0LE1/p6rooGOh1QnL6zflgJkDExswtosl hby+OP3CiIYfp6MppjJ+rrb62F0EaqpORNWzZIO3IN3E4msbHNz/ffzqeCaXbL0aSJw== 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=Q+f4ojTI; 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 80121606A691; Sat, 5 Dec 2026 16:03:44 +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=Q+f4ojTI 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=1796486623; b=QTEpUmlvHzI8jzdUoysZRM06bdOMdcNMVN0Q/cZhW3vAdcpBRb5BMgVRFYDHQYtRNyr/ dd8cvFLPplP+bYPsHB1XHwmZ1H8fcRiIv4kZsmGpalhOK2mQ7B5+t9lAQSvG9nOsBVM7D smY12xM7CTlVBs0gckOZOXKl+Mi/HOC+x7izPORF3nJ9kZy0wwb8MsjCQFzfpobIIUeNh wp/NUumXsrImvvKCri0zjabUTID4+pCmz5Bw7BudiA+8CeqaohFqZEe6WXn1CTEzrQd2m D13mZ0UDB/lTN0+gfBPScVu5N4B/2Sl/ADGyfMJykT50WY7whJf8GKKKAkldYGaL5uw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796486623; 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=B0pB0pcXmDNs/n8/oDlmXgKKJ175xy388bv4PeAraOc=; b=minsL9jPFnBUuN5igkLscqAi14KFmpWXDFIxTpUpCNKzrnAsgtzO93YewbxW1mqheC5l lAI2JAEt7ZTRxQybecHTeH4BYajyHP8t6parf1Dd/ZTMX2d48fOAgsdJNF5WNPZLTCRnD zHfpO0+xwf3oKphGLY70skIHdT0b6lTfjV09p7Gjs6UzouX7ur5Q0T2i1FRojmvUqdlUx A+w9xNdo2nmjcrvZ4icCesxBeQk9xbPJ+dbj/W2Upjkg9RevoWpp+Tlkc5lY0FqaEZ4+E hGnyhvUx4SHKn9sqAE2PZZdk8qeoXCgNt/wNCSGQRtsK4XzZ0F7Si9mSvgnEVA9cOxA== 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=Q+f4ojTI; 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 9F265606A33D; Sat, 5 Dec 2026 16:03:43 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36E671F0092B; Sat, 5 Dec 2026 16:03:42 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796486623; bh=B0pB0pcXmDNs/n8/oDlmXgKKJ175xy388bv4PeAraOc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Q+f4ojTI04hSzCiZfJo33mKTE0jRZrK5V7f2pEE6pUQOzOmCovq6v1G9L+7tcgXlv XDPlTnGsN9pYzczcDzW279oFVGnVUhaaSDPx5b8wtHpFeBum0gWruYhIwvQE9kD7ut 9rGYDhnNYIl4NRnZWqVs+9fFzmwyPQ6PFfeAyipI4DO0jYsOhU1fc0k82L3LChaEk6 4c5+e5q1KaZYZBLNYTEvjmVoqSHUiNDWK/doBc+x5BsRI1PmCOwu5XWwFguz3f2ZS0 BlgnH07fny4OUCw2QHZIqok8kdvvrNRSmWGalN8Zn/IZLICCaTWqRQVjXi3wzmamER rbW8uTpewSnPw== X-Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, sebastian.hesselbarth@gmail.com, maxime.chevallier@bootlin.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, richard.genoud@bootlin.com X-In-Reply-To: <20261204152836.31432-3-jszhang@kernel.org> 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