Article View: linux.kernel.netdev
Article #21425Re: [PATCH net v8 1/5] net: phy: move irq_suspended and irq_rerun out of the bitfield
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 01:11
Date: Tue, 24 Nov 2026 01:11
76 lines
10815 bytes
10815 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 patch adds this comment above the two new bools in struct
phy_device (include/linux/phy.h): "Not bitfields: phy_interrupt() andβ¦
--
net: phy: move irq_suspended and irq_rerun out of the bitfield
This commit turns irq_suspended and irq_rerun in struct phy_device from
1-bit bitfields into separate bools. phy_interrupt() and the PM callbacks
write them without phydev->lock, so a read-modify-write on the shared
bitfield word could lose a concurrent irq_rerun update. The call sites in
phy.c and phy_device.c are updated to use true/false.
[ ... ]
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 21afc2082b174..59c75296d5355 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -726,8 +726,11 @@ struct phy_device {
>
> /* Interrupts are enabled */
> unsigned interrupts:1;
> - unsigned irq_suspended:1;
> - unsigned irq_rerun:1;
> + /* Not bitfields: phy_interrupt() and the PM callbacks write them
> + * without phydev->lock
> + */
[Severity: Low]
This isn't a bug, but could this comment mislead readers about the
bitfields that remain?
The reason it gives, written by the PM callbacks without phydev->lock,
also applies to interrupts:1 on the line just above it. PHY driver suspend
callbacks run from phy_suspend()->phydrv->suspend(), and phy_suspend()
does not take phydev->lock. For example, in dp83867_suspend():
drivers/net/phy/dp83867.c:dp83867_suspend() {
...
if (phy_interrupt_is_valid(phydev)) {
phydev->interrupts = PHY_INTERRUPT_DISABLED;
dp83867_config_intr(phydev);
}
...
}
marvell-88q2xxx.c and micrel.c do the same thing in their suspend paths.
phy_suspend() also sets phydev->suspended = true without the lock, and
suspended:1 is in the same bitfield word.
Both fields still share that word with link:1 and autoneg_complete:1,
which the state machine writes under phydev->lock. From this comment, a
reader could conclude that the remaining bitfields in the word are only
written under phydev->lock.
Would it be clearer to word the comment so it doesn't imply that rule?
It could, for example, just describe the irq_rerun race that this patch
fixes.
> + bool irq_suspended;
> + bool irq_rerun;
>
> unsigned default_timestamp:1;
>
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123-b4-phylib-mac-pm-irq-v3-v8-0-e9f706e79614%40iav.lv
Technical Details
Message-ID:
<179548269686.3135.9876460710453451136@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-369907-linux-kernel-netdev=dewy.ruReferences:
<20261123-b4-phylib-mac-pm-irq-v3-v8-1-e9f706e79614@iav.lv>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-369907-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v8 1/5] net: phy: move irq_suspended and irq_rerun out of the bitfield Date: Tue, 24 Nov 2026 01:11:36 +0000 Organization: Usenet Network Message-ID: <179548269686.3135.9876460710453451136@kernel.org> References: <20261123-b4-phylib-mac-pm-irq-v3-v8-1-e9f706e79614@iav.lv> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4023155"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wf8k6nm8PfdHgAv/oXofV/zGoCg= sha256:qmx7Z5Xwe0FpoJKfB72PUUUGdkIIbR1FKCZz6MX0qmU= sha1:Fzm+72zgo38bToc6Z7178xWAHCg= sha256:SqIvCuWFG0ILp09bmyS3GOrNoEDPxnfmq0/mo1H4Dkc= 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 DE8D7125DC8; Tue, 24 Nov 2026 04:12:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, 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 nNJ9odYh3sqb; Tue, 24 Nov 2026 04:12:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369907-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 CB8A8125DC9; Tue, 24 Nov 2026 04:11: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 3F20F3254F; Tue, 24 Nov 2026 01:11:46 +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=1795482704; b=ceVFCg3Tpt3HAlFkvVOSq04IpEZ9zBBjzVaiaN6tAV52e1BR5LSQgkBiNVNHDTJrbNv2 pzmnl+G4vVP5/PrfDvrURl0C+wVLqslZKdqjJ0Ef7IDaHI3LKWq65z74p/g23bNjCrwbA xtEI6OPmZiRW48O5IJkjWmdSGvgLr1eH8zNLdSCT8iTgzD9GS6mdq2fuhQNLSKEvRumop v55VVUl095hz178kf/9icoykX9phL6SP7Rci4TVtOt3mbcBv2PMTM44KW+ecIztM0SK1y HvUomb/PpqZZWOjaH9J7U1dNmOkcMVzBA6Fz6FQZt6YZ1RyFgOtahoVdWuEma28PjdA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795482704; 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=wgEWWEO3qdUk7hR9XMnjX/hWMNEVu9/1SaZ+lWZNOmQ=; b=plcxc/vuTHucVkhnDs+2o5JFeTNdLaz5WZCSiyq1xrlRUhueMYW7RM1oTJRHgZ+mtARM 4JncAA8N0XMx0hfz4r8OJOn+VEUI8rh8vN0ikRMbH3RiPAtzYlowRSfvMNsC1S06++qoo MnxGY3MJVo82hOnfdzVHpjVHKsmKHsRErKgz45sJqJykfTctn4CbYOCNUw6Dk37D/3unI 5Bu9k7t/0mxB2ho9Xr7NpShBTVqS7XKDZN5QdpK6I7Ik+iaqDbfQtE2aiSgiLtgEIQs2G IYc/HkUBfdbdHk7fIDCMldC/cuQu/ZJDe0IOzzLDpYjoj/a8f/fmMh5V2e9YSnZ/F8A== 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="oeM5/T4W"; 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 B4EA1606A689; Tue, 24 Nov 2026 01:11: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=oeM5/T4W 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=1795482698; b=4vCsJODJyMaBxumnMgXS6pRIWaWVIwzm6M6W2wyJ9zej7tIbhdpiWrn067wIYCWizReL lzcFGGDLWJ6HVwHTbbZUAffm0YvRO3QwGvNPr4Qu86Snz+Qf6E4USXwvijmvWde+f43Cx CnNyXnb7pFhBMgKNdLEoZ4OhgVGOi5ytT55280tH4Z/PYxSRUGr1UG0qeho9RMRbHPfdT 8WrtIFUCxGny/hcOz7XiR22xUVHLQmaSiY+H7ZW6odOeR1L/Mq96xtNf5fuhEOd18YJ5D KY5ijuh0V6EfqYqJr1NRYHR7oDkDYoD73fn7sKQ1wH6ZmfTkAikhyEjNb+21N7UyucQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795482698; 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=wgEWWEO3qdUk7hR9XMnjX/hWMNEVu9/1SaZ+lWZNOmQ=; b=4J385NyHgBEt9Q7iue9vHrg0ONeENRy3C3xA4AZX23l9M4t7Q7Aev4FtHgPGOlx/ikpT 2Dy+tOd6BB1j2o9rhmWgitLPOm2YPoqHJO02HwaiY6mZkbUsFTp8xHu8vhswlPfTiYklE RdNxx8PIiP8TEvrlwtYTM5B859G+02boLBSXbKPpjGDhQVX1kkGkew8gA5WuxLIWGVzGm LhdNvgRJOJGiEIHm77GiYX7eTJgbDRwZqr78Yl2S1jtnCvhVCYHCdaV8MMax5HgO94lSj P4ONhi3yUJmF7UMqOoyrwmBuz2gprfGmzHnOMgLpKztGMGfmlrsc8YsBopCYpDngJCw== 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="oeM5/T4W"; 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 D21B2606A321; Tue, 24 Nov 2026 01:11:38 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC211F000C4; Tue, 24 Nov 2026 01:11:37 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795482698; bh=wgEWWEO3qdUk7hR9XMnjX/hWMNEVu9/1SaZ+lWZNOmQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=oeM5/T4WRAeChpjv3sI9v50CsIdchJV2dJLzdy3D1UyfZyHPryAQwdkCExfiOhS2P auMQLvY84UFxPjnTALlROLlweVqtajxuW1Mz+TA7nDN3pi9MLMiSTX+ts0TkDrqf95 xYUfC8QFONSxDhiRUmS3ikrjE+JuhUT8KvMRFycWXP6dTj90M4iQ/LNo76OMuedUWS x2vc/7GP8azbj5Yv3OqBvzN6seFvd/C6NnqAUCLgB8fcWC6y/LcBbr+UbMTpIGQPoO rlw1imgepY3c+OmUrAtE/g5f9RNcbaAQ1ARTkCIGIQUtgpjZkK6kYuFzsB8M6dBCiu Fl71pzPQRuL8w== X-Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, tglx@kernel.org, linux-pm@vger.kernel.org, maxime.chevallier@bootlin.com, lukas@wunner.de, rafael.j.wysocki@intel.com, wei.fang@nxp.com, niklas.soderlund@ragnatech.se, paul@pbarker.dev, florian.fainelli@broadcom.com, opendmb@gmail.com, Thangaraj.S@microchip.com, shenwei.wang@nxp.com, Haoning.CHENG@cn.bosch.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261123-b4-phylib-mac-pm-irq-v3-v8-1-e9f706e79614@iav.lv> 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