Re: [PATCH] net: gemini: Free the shared queue after removing the ports
flat view
From: Myeonghun Pak <hidden>
Date: 2026-09-20 00:52:33
Also in:
linux-arm-kernel, lkml
Thanks for the review. You are right on both points. I will keep devm_of_platform_populate() and let the parent's devres release the free queue instead, and drop the teardown from gemini_ethernet_remove(). I will send a v2 with that. 2026년 9월 17일 (목) 오후 10:25, Andrew Lunn [off-list ref]님이 작성:
quoted
Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Assisted-by: LLM Co-developed-by: Ijae Kim <redacted> Signed-off-by: Ijae Kim <redacted> Signed-off-by: Myeonghun Pak <redacted> --- drivers/net/ethernet/cortina/gemini.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 4c762229ce42..e493d495f2ef 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c@@ -2364,7 +2364,6 @@ static void gemini_port_remove(struct gemini_ethernet_port *port) unregister_netdev(port->netdev); } clk_disable_unprepare(port->pclk); - geth_cleanup_freeq(port->geth); } static void gemini_ethernet_init(struct gemini_ethernet *geth)@@ -2656,7 +2655,10 @@ static void gemini_ethernet_remove(struct platform_device *pdev) { struct gemini_ethernet *geth = platform_get_drvdata(pdev); - geth_cleanup_freeq(geth); + devm_of_platform_depopulate(&pdev->dev);This seems wrong. If you have to call devm_of_platform_depopulate() why are you using devm?quoted
+ writel(0, geth->base + GLOBAL_INTERRUPT_ENABLE_4_REG); + if (geth->freeq_ring) + geth_cleanup_freeq(geth);gemini_ethernet_remove() is supposed to do the opposite of gemini_ethernet_probe(). What is the opposite of geth_cleanup_freeq()? Where is it called in gemini_ethernet_probe()? Andrew