From: netdev-bot+sashiko@kernel.org
To: linusw@kernel.org
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
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 [thread overview]
Message-ID: <179554498743.3135.16883208999993946923@kernel.org> (raw)
In-Reply-To: <20261120-gemini-ethernet-fixes-3-v9-1-298671d799d5@kernel.org>
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
next prev parent reply other threads:[~2026-11-24 18:29 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:29 [PATCH net-next v9 00/14] net: ethernet: cortina: Fix Gemini RX buffer management Linus Walleij
2026-11-20 17:29 ` [PATCH net-next v9 01/14] net: ethernet: cortina: Keep shared free queue parent-owned Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko [this message]
2026-11-20 17:29 ` [PATCH net-next v9 02/14] net: ethernet: cortina: Keep ports bound for shared IRQ Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 03/14] net: ethernet: cortina: Drain free queue IRQ before resize Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 04/14] net: ethernet: cortina: Normalize free queue pointers on rebuild Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 05/14] net: ethernet: cortina: Correct free queue DMA mappings Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 06/14] net: ethernet: cortina: Index free queue fragments with XArray Linus Walleij
2026-11-20 17:29 ` [PATCH net-next v9 07/14] net: ethernet: cortina: Preserve in-flight free queue pages Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 08/14] net: ethernet: cortina: Rotate free queue page allocation Linus Walleij
2026-11-20 17:29 ` [PATCH net-next v9 09/14] net: ethernet: cortina: Recycle claimed free queue pages Linus Walleij
2026-11-20 17:29 ` [PATCH net-next v9 10/14] net: ethernet: cortina: Separate RX buffer capacity from free queue size Linus Walleij
2026-11-20 17:29 ` [PATCH net-next v9 11/14] net: ethernet: cortina: Validate RX fragment lengths Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 12/14] net: ethernet: cortina: Account RX buffer size in truesize Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 13/14] net: ethernet: cortina: Release partial RX frames on stop Linus Walleij
2026-11-24 18:29 ` netdev-bot+sashiko
2026-11-20 17:29 ` [PATCH net-next v9 14/14] net: ethernet: cortina: Scale Gemini RX queues to system memory Linus Walleij
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=179554498743.3135.16883208999993946923@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=mhun512@gmail.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ulli.kroll@googlemail.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