Article View: linux.kernel.netdev
Article #13537Re: [PATCH net-next v6 01/15] net: ethernet: cortina: Keep shared free queue parent-owned
From: Jakub Kicinski
Date: Tue, 10 Nov 2026 01:16
Date: Tue, 10 Nov 2026 01:16
47 lines
9788 bytes
9788 bytes
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
> diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
> --- a/drivers/net/ethernet/cortina/gemini.c
> +++ b/drivers/net/ethernet/cortina/gemini.c
> @@ -2683,6 +2686,8 @@ static void gemini_ethernet_remove(struct platform_device *pdev)
> {
> struct gemini_ethernet *geth = platform_get_drvdata(pdev);
>
> + devm_of_platform_depopulate(&pdev->dev);
> + writel(0, geth->base + GLOBAL_INTERRUPT_ENABLE_4_REG);
> geth_cleanup_freeq(geth);
> geth->initialized = false;
> }
>
[Severity: High]
devm_of_platform_depopulate() unbinds both port devices synchronously,
and gemini_port_remove() ends with clk_disable_unprepare(port->pclk).
By the time we get here both GMAC gate clocks are therefore off. That
includes this writel() to GLOBAL_INTERRUPT_ENABLE_4_REG and the
readw()/writew()/writel() of GLOBAL_SWFQ_RWPTR_REG and
GLOBAL_SW_FREEQ_BASE_SIZE_REG in geth_cleanup_freeq(). All of them
access geth->base while the block is unclocked.
The parent cortina,gemini-ethernet device does not hold a clock of its
own, and the global registers need at least one port clocked. On ARM
that means one of two things. The writes may be silently lost, which
leaves SWFQ_EMPTY_INT_BIT enabled and the old free queue base
programmed. Or the access takes an external abort on unbind or module
unload.
The child path has a similar window. The clock is gated in .remove,
but devres frees the devm threaded IRQ (gemini_port_irq() and
gemini_port_irq_thread()) only after .remove returns.
SWFQ_EMPTY_INT_BIT is still enabled at that point. The thread can
therefore still run geth_fill_freeq() and rewrite
GLOBAL_INTERRUPT_ENABLE_4_REG on an unclocked block.
Could the free queue interrupt be masked, and the queue torn down,
while at least one port clock is still running? Another option is for
the parent to hold its own enable on a port clock across remove. Which
ordering did you have in mind, given that port 1 owns the refill IRQ?
--
pw-bot: cr
Technical Details
Message-ID:
<20261110011611.1733276-1-kuba@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359735-linux-kernel-netdev=dewy.ruReferences:
<20261103-gemini-ethernet-fixes-3-v6-1-c4b5ff8a65d8@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359735-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 01/15] net: ethernet: cortina: Keep shared free queue parent-owned Date: Mon, 9 Nov 2026 17:16:11 -0800 Organization: Usenet Network Message-ID: <20261110011611.1733276-1-kuba@kernel.org> References: <20261103-gemini-ethernet-fixes-3-v6-1-c4b5ff8a65d8@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="490549"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:gZIahhp6ejZjHmk8zSnsKctuzp8= sha256:7Nb89/4cZj9HjttZm7JMQbsmqMhXkTrSvb08Pcjp4pI= sha1:/HhK3OGxg2Ij7EkQdQrmDIDCL8Q= sha256:LTrqSwBp4H5+zBFNMiEL+KOwobq0eZL6y8+zz0/PwNY= 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 262391139C6; Tue, 10 Nov 2026 04:16:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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 xr6pd0JWrdKI; Tue, 10 Nov 2026 04:16:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359735-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 10261110DDC; Tue, 10 Nov 2026 04:16:22 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 0BFCF61BBCA; Tue, 10 Nov 2026 01:16:17 +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=1794273375; b=4YOiZSOOXzAKoyl2oD9CQmp3VMFK04iC7zQZ3058z0Vi5+v3erVzK2qp1POQudKwuSvJ 70yZ2/rrZNifHHJKVmIKrOEfAngUkHT385NT2QcEQksv9bT+7POh/ukw6qYhwdMuDaCBc 9OEvaOTi5kyiTnL+tResNXljbvWOIdrtkMcNWLnW1g1LZ2D1BkNaoCcAhzbkTjwFD6pSt sOog1qs6s0QTFYPlA9ulB8DJxHFNrP8HUKe6jzKZOG5MlvWQzohYalOUgSiXeehu3yYjF WiLLv/nOxsbrdxTwen9n26KVuIjDbjLo1zmsEqc+UNqxA4UeAZsIYHzku8DFqER12Bg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794273375; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding; bh=iLc81dlIMgk2M36hvoTrJto1aOwZcteM9MGtiO2fY2M=; b=FbZ4sE5WPdy8dqkLzXCR/q2Z2d7qIaIQ6W5kP1If7/eLtzMwvN/3s583uJ0ufH5rnuwX sKBv1wipFJ5eYZcYLn98oKCwQcf0BWp0X9YKe8Bxh4auKf0opa+shlkPm0AK8ERbRcVnQ FoLp8GTfqF4xnzFMA6fWmdu3y78HjwGIyW+hHVReCdLMgtnq9VH98VU+PNf/NkPKYhUQs Ufy0O0pb7KApS8/uzKB5C3Svev/RzHZmWBKtynCJmvsBwgmVYTmyGj+yp+93py6Y+ChvH aYD2PfDkVC6allNgf73hfYS3en/1hZqvtvO67y+9bTbM8yCLaAbRrrpYaAAKWB1/yZg== 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=UlYCuXP5; 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 21840606A334; Tue, 10 Nov 2026 01:16:15 +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=UlYCuXP5 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=1794273374; b=YY4tP/d9pTl4r2s9XiW/nhqlurK3x+9CJXnIW6j9OEJkcQEriTZ+AviUtx1fUMUaAN9z aBDNekkx3BXiCwR/+oMQ6rqEN4DeVFVdMkBrRhb0uaIxYfLVMTMilOIXOTvtENqYzMgQz WTUvexCvoqHDQ4rHYR3tLyK3gGV/4LppUhKZQpy6KFJEgykxa8wHdFfHnMk6DQYWdRn+o c+oDvU39HB4qfrWV55x5hOXq/gu7NYLkS41SYEzFEBqK2wob+J+kDmnZgztnk2ve66V8v IpCLzYzis7eQ7UZ9ZZXEVlvXMq1MHfbghNmhlguYDmzuS3AHTwBzfp0UlYSd+klfhTg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794273374; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=iLc81dlIMgk2M36hvoTrJto1aOwZcteM9MGtiO2fY2M=; b=wl8oS8i5jT44bow4D6mjRN91iTC4TutKMOdkJJQrk2MozZcJ69+X2JvNqdGIWeA3yPvZ Wrei7JTlhwn7ESdkLUeF0ycGEUae1SJBE7Ul6u3etdQpQvBHJynuVpMUbuc2DLCq6i8km nshubMouViDUGWUvz7srN0FU+QiJ45i5HAQYvpRiIzOYT4d20nzjiztgvRS92z+xxQxnb vhtNg/t/p0Y9crILFRdXzjlFPNy0tL/IAKepi9p+NTJXU+yRF/QDYf5atR05epiEwBOL0 htr4UTnizzxiZ/Tidoo7eBZCXFurT/MjjZO8B5iYXbankL2HMH9ro1AStjEQBFFWlQg== 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=UlYCuXP5; 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 04824606A31C for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 01:16:14 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32D9D1F008A1; Tue, 10 Nov 2026 01:16:13 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794273373; bh=iLc81dlIMgk2M36hvoTrJto1aOwZcteM9MGtiO2fY2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UlYCuXP5qUbNGVuXojiiiMM/LZU5CtEReERVS6T/FE14g2XvIU8dxGcA4pjkCn8Jc 391xfNoQN4G9IUko709333YrENN3H6WWN87UCDLBwD26Me4leFURGXEgLNh7VHa4Sy 7tRfacETls+qGTwDJ0MtOveNzEtgFvXoOryTOkOh1KPP1MFe2Iyc9aq1fLtxAtP6yn w/1vpYKIaDKZO+UhfMUGpNRkslGHSmK6Mmbrb57TzN8gVJKh29TB5v7i2HsCkwKu/W RgcoKPVNmc8XOnjNy8/ISRf23flRaR5+dydAqVP1Tkf94QTStV7db+lCMp0QF0GtZe GJNK8m9cVc0og== X-Cc: Jakub Kicinski <kuba@kernel.org>, ulli.kroll@googlemail.com, andrew+netdev@lunn.ch, davem@davemloft.net, pabeni@redhat.com, mirq-linux@rere.qmqm.pl, mhun512@gmail.com, edumazet@kernel.org, netdev@vger.kernel.org X-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261103-gemini-ethernet-fixes-3-v6-1-c4b5ff8a65d8@kernel.org> 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