🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7590

Re: [PATCH net v2 1/2] net: phy: move irq_suspended and irq_rerun out of the bitfield

#7590
From: Igor Velkov
Date: Mon, 26 Oct 2026 17:32
15 lines
10212 bytes
On Mon, Oct 26, 2026, Andrew Lunn wrote:
> As you say, it is an IRQ thread. Because interrupt handlers might need
> to access the PHY, which is a blocking operation,
> request_threaded_irq() is used in phy_request_interrupt(). So you can
> just take the mutex and make the RMW thread atomic.

The lock in phy_interrupt() only orders against writers that hold it.
phy_suspend() writes wol_enabled and suspended unlocked, e.g. from
phy_stop() in the MAC's suspend while the link-down interrupt may set
irq_rerun, and it cannot take the lock: phy_may_wakeup() can call
phy_ethtool_get_wol(), which takes it. mdio_bus_phy_suspend() and
phy_config_interrupt() write that word unlocked too. As bools,
irq_suspended and irq_rerun share it with none of them.
Would you still prefer the lock?
Technical Details
Message-ID: <20261026-phylib-v2-lock-reply-1@iav.lv>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352023-linux-kernel-netdev=dewy.ru
References: <20261026045343.837889-1-iav@iav.lv> <20261026045343.837889-2-iav@iav.lv> <b99454f1-9c3e-42eb-ad03-3941015879a2@lunn.ch>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352023-linux-kernel-netdev=dewy.ru
From: iav@iav.lv (Igor Velkov)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 1/2] net: phy: move irq_suspended and irq_rerun out of the bitfield
Date: Mon, 26 Oct 2026 19:32:15 +0200
Organization: Usenet Network
Message-ID: <20261026-phylib-v2-lock-reply-1@iav.lv>
References: <20261026045343.837889-1-iav@iav.lv> <20261026045343.837889-2-iav@iav.lv> <b99454f1-9c3e-42eb-ad03-3941015879a2@lunn.ch>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1360068"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wYjJimSaRhoGDs9xDJDeXXSRCpM= sha256:/RS5ud7AoxCaUr3Rjiody5xgFaYXePb2xaGJU/J13+4=
	sha1:Ikf+6TjRz0Us0T6XsItuvEfsSz8= sha256:oHS14xynLdeXltF2+RpccdIMlx1TsZyL2SquCROM15I=
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 0B5E5125BB1; Mon, 26 Oct 2026 20:33:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	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 (1024-bit key)
	header.d=iav.lv
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 7-lABDhcqjg8;
	Mon, 26 Oct 2026 20:33:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352023-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=iav.lv
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 92154125BAE; Mon, 26 Oct 2026 20:33:07 +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 D4AD72984A; Mon, 26 Oct 2026 17:32:54 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793035974;
	b=2rXVINe+u4po1EW6eDm/5nAvDFj0XkLEyiyDWRjYi/enSsnZrsRssNTqrWk5N1daltta
	 Q/eAJV8UiFN6mWyzDoxkYHeZryCtfng3dS8JhbP1ThAx8n+Y8prHXeTj2CiTQkspacB1O
	 7rHNypv4dODLi0hPGJuS4PMI+zx8bv04HvWxgfcZ/TTnvRVckpR6OOOgofLIaOyhktVmj
	 mDXpBaakyFj8jVbgWZf4B3Tuo3NpGrOMmSXE3IEuAQtG+6o4fIAoiL5dvkk0+TFEdJSvV
	 u9AePvN2uflftAaSJ+/bGiPjZF9T+X02b31bJccYqZ2HObEC7CAiFjHRzSQEXc/IadQ==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793035974;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=m21+6xwsTas/4aG1GnIOqBxWmhfu5Hmar62qCJvzW0Y=;
	b=vKl5NTAwJDYQMh39i4VQef7Yo7K34DGeg1mUvnOvUEmVQpEeU2/NOM8/QVDloJvv7lo5
	 mOIqH/6d3kkC2ls+ji6C/y25WcT8rPD0+QTf/Yyh7jmn3pJB0BV7NKVZsmLb2X2hoQc+m
	 y/BCFrcfNyHga9FrII1KuO7wI+HkPQVAIwVK0I7tGTjleNryu/OF65+nwWVF6CGlY3q+H
	 ar13XwS7ezL3GDwyNI9j72gd12NOVw95U+zntzNscjkCJjnenDeqsmiTeLiqT79XCpN5y
	 XK6iBqubMutaf7bprQglv3qTuw8mQcXCc0nslRVZBQZMtDg21ghyJQt1Wz7jDqmsipQ==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=iav.lv header.i=iav@iav.lv header.a=rsa-sha256 header.s=zoho header.b=L4B9SDM2;
	dmarc=none header.from=iav.lv;
	spf=pass smtp.mailfrom=iav.lv;
	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 7473B606A322;
	Mon, 26 Oct 2026 17:32:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=iav.lv header.i=iav@iav.lv header.a=rsa-sha256 header.s=zoho header.b=L4B9SDM2
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=136.143.169.15
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793035973;
	b=ZTb7i9Go0rfkufxoMBWNpPQSoVx2xhvKhdNNXnLKAmyamzbw2MASHkn0uztgy1ZQ//BP
	 1LYHiW2xRWsnZ3au3dhw9xZcQc9mPLrX1rategKXC3zN8mzDkeRiGnfcrUJysakLkw6d0
	 F7c3d8vc5aY0OxbSO84s3hG0bC8E+/frEuaJriEIFqViwGsEbrXLczduDRTiw2L5SN8CT
	 WSlMIny9gzD4JcvK97xL6O7YWPT/y8oguz1/34WS0eA1HsTTcxG5cC+W2izvrD6DxYE5z
	 lS77i/o4zVfRZY5eE+AkSQUXZ6gYt/J3+JWSir5f937e4rPvob8flhU01gSaQA7ntbg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793035973;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=m21+6xwsTas/4aG1GnIOqBxWmhfu5Hmar62qCJvzW0Y=;
	b=vSRKEDyv8tMXVtA4PJhCpxrjxZWoFMm/tv1GZmhsEkJaTeF+4ZjGPdrk4s7n3BSZvCnK
	 dCXekNXRGN5QDLk2O4ScEVoc87ORrQZE7eiVQeShOVnH5m+8LglcnZR2cAElaq4E4WghK
	 G0MDdE98bM4H5ZdpXpHrdQqAvlDOHC6n10l4u9n3dKlLKjZhn5vvUhR08hXoMxt7iPUY1
	 o+UAv49gGXD2dlxdV36VZTCT0mYTp7lczR+GfP611hFQFq1Ws6CNrXt8tHz1Lnuq7Z4tR
	 S+O7GLNpV5jladgL5fbjiuQ/bOslZc9CKKKsyNO8u7L93ra2ym987tEMXcuw2+Kp0xg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=iav.lv;
	spf=pass smtp.mailfrom=iav.lv;
	dkim=pass header.d=iav.lv header.i=iav@iav.lv header.a=rsa-sha256 header.s=zoho header.b=L4B9SDM2;
	arc=pass header.oldest-pass=0 smtp.remote-ip=136.143.169.15
X-Received: from sender-op-o15.zoho.eu (sender-op-o15.zoho.eu [136.143.169.15])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54FD0606A31A;
	Mon, 26 Oct 2026 17:32:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 54FD0606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iav.lv
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iav.lv
X-ARC-Seal: i=1; a=rsa-sha256; t=1793035938; cv=none; 
	d=zohomail.eu; s=zohoarc; 
	b=L4zQ3u3Gh1/7EhzANUJon02xknPj3GiVgg4ZS0UxAbpSBG3w65jqGNeozU9TGhN5ddGM/1bLqnvOnZWFX87gH7Oaq4FdiDDhXR79wY+0+Mg3gFDo6xycPHWn3/e54VX5CXlNouVacY7sXdE2TJc/MnaGk7CPvBBLHwr7eDJ1K/U=
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; 
	t=1793035938; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=m21+6xwsTas/4aG1GnIOqBxWmhfu5Hmar62qCJvzW0Y=; 
	b=IZO9T7/N/eOCy0jaC29UtkZmDSKqbPk3XXDzZJSrn9HC0dk/sgxTzDMirfbx8SO4F2rqmwF5jtmn5MumsZDiugnLRu+c0o0xZhEbVLygo5eiCO2skCw3XgF/3ppsclAwAYHCNmMZwtg6PJoKopIG/z3gbS6J3vHbKHUJ8q2Su7M=
X-ARC-Authentication-Results: i=1; mx.zohomail.eu;
	dkim=pass  header.i=iav.lv;
	spf=pass  smtp.mailfrom=iav@iav.lv;
	dmarc=pass header.from=<iav@iav.lv>
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1793035938;
	s=zoho; d=iav.lv; i=iav@iav.lv;
	h=Date:Date:From:From:To:To:Cc:Cc:Subject:Subject:Message-ID:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=m21+6xwsTas/4aG1GnIOqBxWmhfu5Hmar62qCJvzW0Y=;
	b=L4B9SDM2cdS9Q7k+OkzkqgqYuPMF+hd+yoekcQcM57YAYK1l8dWh3QwXuE0ZBku7
	x2V2qDOioR+uHpGrbrPzJXG+JbK2bt32byxKSexnZJLa5xupW73zSUgs3poLkvPsfiT
	OKfPiduLZOZEKpaOTQqf60FBNuskYqk+taKAiYsg=
X-Received: by smtp.zoho.eu with SMTPS id 179303593657064.19003206138837;
	Mon, 26 Oct 2026 18:32:16 +0100 (CET)
X-Cc: Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Lukas Wunner <lukas@wunner.de>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, Wei Fang <wei.fang@nxp.com>, Niklas Söderlund <niklas.soderlund@ragnatech.se>, Paul Barker <paul@pbarker.dev>, Florian Fainelli <florian.fainelli@broadcom.com>, Doug Berger <opendmb@gmail.com>, Thangaraj Samynathan <Thangaraj.S@microchip.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Velkov <iav@iav.lv>
X-In-Reply-To: <b99454f1-9c3e-42eb-ad03-3941015879a2@lunn.ch>
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