Article View: linux.kernel.netdev
Article #22014Re: [PATCH net-next v9 01/14] net: ethernet: cortina: Keep shared free queue parent-owned
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 18:29
Date: Tue, 24 Nov 2026 18:29
123 lines
12479 bytes
12479 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] The commit message has Reported-by and Closes tags but no Fixes:
tag and no Cc: stable, even though the patch fixes user-triggerable…
- [Low] gemini_ethernet_probe() now gets every available child's PCLK
with devm_get_clk_from_child() and enables it with…
--
net: ethernet: cortina: Keep shared free queue parent-owned
This patch makes the parent gemini-ethernet device the only owner of the
shared software free queue. The parent now depopulates the port devices
before it cleans up the queue, and it keeps the port clocks enabled itself.
Each netdev is now unregistered before its PHY is disconnected.
Closes: https://lore.kernel.org/netdev/20260917192835.58126-1-mhun512@gmail.com/
> diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
> index 3ed8b1ae0bbc2..f198e535f1a00 100644
> --- a/drivers/net/ethernet/cortina/gemini.c
> +++ b/drivers/net/ethernet/cortina/gemini.c
[ ... ]
> @@ -2387,11 +2390,10 @@ static irqreturn_t gemini_port_irq(int irq, void *data)
> static void gemini_port_remove(struct gemini_ethernet_port *port)
> {
> if (port->netdev) {
> - phy_disconnect(port->netdev->phydev);
> unregister_netdev(port->netdev);
> + phy_disconnect(port->netdev->phydev);
> }
> clk_disable_unprepare(port->pclk);
> - geth_cleanup_freeq(port->geth);
> }
[Severity: Low]
This isn't a bug, but should the commit message carry Fixes: tags, and
maybe Cc: stable?
The geth_cleanup_freeq() call removed from gemini_port_remove() here goes
back to the original driver. gemini_ethernet_remove() also calls it, so a
single parent unbind or module unload could run the cleanup up to three
times.
geth_cleanup_freeq() never clears freeq_ring. The later runs then call
dma_free_coherent() and kfree() on memory that was already freed. Unbinding
before any interface was opened also dereferenced the NULL freeq_ring.
The phy_disconnect() before unregister_netdev() order was added later. With
the interface up, it makes gmac_stop() call phy_stop(netdev->phydev) with a
NULL phydev.
Something like:
Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Fixes: 3e813d61401a ("net: gemini: Clean up phy registration")
Without these tags, stable trees that still have these bugs may not pick up
the fix.
[ ... ]
> @@ -2656,6 +2666,30 @@ static int gemini_ethernet_probe(struct platform_device *pdev)
> return PTR_ERR(geth->base);
> geth->dev = dev;
>
> + /* Keep both port clocks enabled until the shared queue is torn down. */
> + for_each_available_child_of_node_scoped(dev->of_node, child) {
> + struct clk *clk;
> +
> + if (!of_device_is_compatible(child, "cortina,gemini-ethernet-port"))
> + continue;
> +
> + clk = devm_get_clk_from_child(dev, child, "PCLK");
> + if (IS_ERR(clk))
> + return dev_err_probe(dev, PTR_ERR(clk),
> + "failed to get port clock\n");
> +
> + ret = clk_prepare_enable(clk);
> + if (ret)
> + return ret;
> + ret = devm_add_action_or_reset(dev, gemini_ethernet_disable_clk,
> + clk);
> + if (ret)
> + return ret;
> + clocks++;
> + }
> + if (!clocks)
> + return -ENODEV;
[Severity: Low]
Is the commit message accurate about this part? It says:
Hold parent-managed enables on the port clocks across child removal, IRQ
draining and shared queue cleanup, so teardown never relies on clocks
already released by the children.
gemini_ethernet_probe() enables the clocks, and the matching
clk_disable_unprepare() runs as a parent devm action. Both port clocks
therefore stay on for as long as the parent is bound, not only during
teardown.
The patch also adds new ways for the parent probe to fail, and the message
doesn't mention them. Because of the "if (!clocks) return -ENODEV;" check,
a parent with no available port children now fails to probe. Before this
patch that probe succeeded and did nothing.
The parent probe can also fail or defer if devm_get_clk_from_child() cannot
resolve a child's PCLK, since it only does OF lookups. The child's own
devm_clk_get() can fall back to clkdev lookups.
The in-tree gemini.dtsi provides "PCLK" for both ports, so in-tree boards
don't hit these paths. Could the commit message describe these changes?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120-gemini-ethernet-fixes-3-v9-0-298671d799d5%40kernel.org
Technical Details
Message-ID:
<179554498743.3135.16883208999993946923@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-370670-linux-kernel-netdev=dewy.ruReferences:
<20261120-gemini-ethernet-fixes-3-v9-1-298671d799d5@kernel.org>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-370670-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v9 01/14] net: ethernet: cortina: Keep shared free queue parent-owned Date: Tue, 24 Nov 2026 18:29:47 +0000 Organization: Usenet Network Message-ID: <179554498743.3135.16883208999993946923@kernel.org> References: <20261120-gemini-ethernet-fixes-3-v9-1-298671d799d5@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="9229"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:kv5ydNS0SAu5VtguniBTPe7k+G0= sha256:FiNR/VcDewPMh4yQHHbiaCEy+G9LU3Yx2wgZZnMqmx0= sha1:zyiWeiX0rdBB++Xl6O15Uh+4e/w= sha256:2scEzxRG2RRoKoi6SWbBQBTHGPb1ze3Lga3z10hpUzg= 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 9D644125E2F; Tue, 24 Nov 2026 21:30:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 FEPlCcXMjN9B; Tue, 24 Nov 2026 21:30:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370670-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 B9677125E22; Tue, 24 Nov 2026 21:29:51 +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 1774837558; Tue, 24 Nov 2026 18:29:50 +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=1795544990; b=tYXyJsXgZNtLRm6GdA8XOVZspo57Iot57FC/raBirKUix9Kfz1VrtD1WFf7cNJ0muH5r TBCsNY0mRzSKB7dclmFW8/vm0kmWvx2ACfMe3MTYHcKaGt+zDnqSh0L6z4tenBa5Sgirw rEe0dK0A170ONyJq/1w/CQEXT2d15z0Cva/dXTBXEn3uBvEICRd6nGoW7Vh/ImJ5qAQKb x+bbpiKdMu38Z0Udzx97Q1myeeabqXB3ZTeIBLiMGTNHxi5LsTaINb712oWjX+EFX6LvH vub3Am5NfGex8U9kNTm/kPNg1I7QsOQjzkVwCBoUyJm9w7OMJ5WU3ALqjou4D3lUisg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795544990; 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=LwPQvU8HFIEJxsVRsyJ8MuUH901uLz76RTZpffHbgbM=; b=gRLhww5ZcjpzgTsiUW/UxA3zxvU967HXuXP8QzWxRxTEm/hWq8I59RbdyGQpmNKGsRyv cqcgqkKnvLtMLDO2B+zfplK7zN34rRm7HLPqR0O3mq0SCCm6ddRgZoqP69zj+g+eICAp5 ZQ8oG19AWHR9KgMFJCRXL9SF2W9t61q8hTuKYtQIv2Pia0i/FNm0fWnuUzoAPFgYevVSs soNihrDcM3pfGKe2+KxXlBgKKwCG6diQDdqFkK1UWAVFLcd1AQomRjLweWR5RXcUMuzUK zYdOlBN9+lcm3D1CDhut2Sq6jRo90iyBrIC5gn5SoVPe/gvJTDUqKvWHSE4TQo7JiMg== 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=cTiQtxxG; 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 E3D2D606A32A; Tue, 24 Nov 2026 18:29:49 +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=cTiQtxxG 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=1795544989; b=YdQI7ZwJw6YYkM4FMSdAQ2XWy+lBdjFw7JkF7XFJH2XyHSHdSbCAM7T/bVmP6jVjLfpC bHvyCseKnowP03hPL8qgRVUMHH3fctFipuVBVVJC9/aRKel4xXNeI/V65ic1kGvTp4mSq r1A22pS8YwhnkLRHeTjJjgGNJxbGrZxnJ2XkyXUpRxz4XGjk3uBTfPSwpmJC2lYIAWmwn 7gYl2Zy7Hz+/p5jJ7YYl0ga76cTNyKHYy9KTpImn3mgdDCnQ+6qZGPzuH8QGUx4uU3s8W j5knrkrOydb6L4Wj/xAfogqvxhI26FUp7AAsS96UUeFck0hQl0ttOJzOwsqA6WSNNFw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795544989; 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=LwPQvU8HFIEJxsVRsyJ8MuUH901uLz76RTZpffHbgbM=; b=ARKyCo0j7MCELOcegS7eyGUw1nVfJcda/wBYBdSS4f6yjr5d2B5VRsWrHS/j0VXam6eZ nV090AcUjjLVJJo1LRhSKgTA/FyX8gg6HbXnR9ykah4kGZecnUVriAwbuXx3FtqJAg3JV x3nRGNu5pt82WtOoEKpdF+FmqeuiB8iUUz7g4r0rarjrN+1xR4qn4O8P2AvadiCz5LeJl qS5P9kK2NQn65PlvOdDdFSGxHpNL7vucyVCYPsDLNiXpvwud5xWmQGW1LjUT5dv8fgK4K HzoUKkMflH4xV6PUN6SZA3TbDvc6Pv7Uxp8BdOp3amsErvr/pztjFATym6ACbg5iIxw== 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=cTiQtxxG; 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 0BCBE606A31E for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 18:29:48 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEE3A1F000C0; Tue, 24 Nov 2026 18:29:47 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795544988; bh=LwPQvU8HFIEJxsVRsyJ8MuUH901uLz76RTZpffHbgbM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cTiQtxxG+SQwGLzgaWSz6U0Ljmo9ape9xdV2ZhteUS38A3Y9hid3TtP+oUjzQCQry uKh3ZbwGpI2Ai6+lJtMjfNPt/r/hujbTIOfa3HUkvAehrPFdi9wfkLshzks8m55CxH r669/68/CbUjgTJTyGQf+NlNq4klB547cdDR2JZHGfeEQqCVUYassN9w2SA9ZF3x+5 pJX9ZDycRYeNDMQv8tOLX7yjGdbMLToLm3n+01w57jvQkrp16n2DO6AypIbmTfdkR1 EBSLKBKo5K5YGSOP0XM1daMB/fZID5VSMJv5jPwdVX3UGyhSJYuQfA47RKZOuoLauj vtjWckPMVqOjw== X-Cc: ulli.kroll@googlemail.com, andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, mirq-linux@rere.qmqm.pl, mhun512@gmail.com, edumazet@kernel.org, netdev@vger.kernel.org X-In-Reply-To: <20261120-gemini-ethernet-fixes-3-v9-1-298671d799d5@kernel.org> 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