🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19943

Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks under global dpll_lock

#19943
From: Vadim Fedorenko
Date: Fri, 20 Nov 2026 20:00
113 lines
14562 bytes
On 20/11/2026 07:39, Ivan Vecera wrote:
> On 11/19/26 22:38, Jakub Kicinski wrote:
>> Well, I'm not convinced. The relations between objects in DPLL are
>> already quite hard to follow, and objects from one driver routinely
>> "plug" into objects from another. The explanation of the locking
>> rules in patch 9 does not look clean or clear. The driver facing
>> API needs to be much more "dummy-proof".
> 
> Fair enough. The complicated part of the rules comes exactly from
> that: a pin registered by another driver, like the zl3073x pins that
> ice registers with its TXC DPLL or uses as parents of its RCLK pins.
> A message about such a pin runs callbacks of both drivers. I have
> prototypes of the first four ways below to lock this, each with KUnit
> tests, and would like your opinion before going further.
> 
> In all of them a domain is the set of objects created with the same
> module and clock_id, dpll_lock becomes an rwsem for the topology and
> lifetime, and a mutex per domain serializes the callbacks.
> 
> A) Pin's domain (this series)
> 
>     Callbacks of a pin run under the domain of the pin, whichever
>     driver registered them.
> 
>     Pros:
>     * one domain lock at a time, so no lock order
>     * a request or a message about a pin is atomic
>     Cons:
>     * the callbacks of a foreign pin are serialized with the driver
>       that created the pin, not with the other callbacks of the driver
>       that registered it, so that driver has to protect the shared
>       state itself, and lockdep cannot check it
>     * restrictions for measured_freq_get, reference sync pairs and the
>       private data of a parent pin, which patch 9 has to explain
> 
> B) Registrant's domain, deferred notifications
> 
>     Each callback runs under the domain of the driver that registered
>     it. A message about a pin takes the domain locks one after another,
>     and notifications from callbacks are queued and sent once the
>     domain lock is dropped.
> 
>     Pros:
>     * callbacks registered by one driver instance are always
>       serialized with each other
>     * one domain lock at a time, so no lock order
>     Cons:
>     * a request or a message about a pin registered across domains is
>       not atomic
>     * the most complex core: a notification queue per domain, a lock
>       per object to keep its messages in order, and pin setters split
>       into validation and apply parts
> 
> C) Registrant's domain nested under the pin's domain
> 
>     Pros:
>     * callbacks registered by one driver instance are serialized with
>       each other and with the driver that created the pin
>     * a request or a message about a pin is atomic
>     Cons:
>     * the lock order comes from the topology, so a pin of A registered
>       with a DPLL of B together with a pin of B registered with a DPLL
>       of A deadlocks, and lockdep sees it only with a lockdep class per
>       domain
>     * a stuck foreign registrant stops the domain of the pin
> 
> D) Merged domains (your suggestion)
> 
>     Registering a pin with a DPLL or a parent pin of another domain
>     merges both domains. They are not split again.
> 
>     Pros:
>     * the rules for drivers stay as they are with the global lock
>       today, and lockdep checks them; the only new one is that state
>       shared between chips not connected by a pin needs a driver lock
>     * a request or a message is atomic
>     Cons:
>     * only hardware not connected by pins runs in parallel; on the
>       GNR-D system the zl3073x and all ice PFs end up in one domain
>     * a callback that waits for the hardware, like the planned resync
>       for up to 1 s, or for firmware still stalls all DPLL devices in
>       the merged domain
> 
> E) Global dpll_lock, slow callbacks asynchronous
> 
>     Pros:
>     * no change in the core
>     Cons:
>     * the resync problems from my previous mail, and a callback that
>       waits for firmware still stalls all DPLL devices in the system
> 
> I wrote before that stretching the domains would not improve
> anything on that system. That holds for the ToD stall I measured,
> but the zl3073x does not need to hold its channel lock across the
> edge waits. Without that, the remaining waits are the planned resync
> and output state callbacks, and with D they stall only the devices
> wired to that chip, which depend on it anyway.
> 
> So I lean towards D, as it gives drivers nothing new to get right.
> Would that address your concern, or do you see a better way?
> 
> It would be good to hear from the other DPLL maintainers as well.
> Jiri, Vadim, Arkadiusz, what do you think?

I totally agree with Jakub. Current implementation of DPLL subsystem is
over complicated, and all these complications came just to completely
model what was designed for Intel NICs, basically ice driver. But now we
are again back to the discussion how to complicate things further just
to fit what was implemented in the new generation of the same hardware.

Maybe it's time to step back and think if we really need all this, or
find simpler way to express/model things?
Technical Details
Message-ID: <ff8b63b7-b943-444a-bd37-b6fb493b5d9f@linux.dev>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368114-linux-kernel-netdev=dewy.ru
References: <20261111164021.273409-1-ivecera@redhat.com> <20261116181612.107a4b57@kernel.org> <fe1dcdd5-ef75-4231-bf9f-03bf8536c2aa@redhat.com> <20261118174424.32e9f130@kernel.org> <dd1d61d7-7bef-4a02-8518-e17d2f50369f@redhat.com> <20261119133851.3f25074c@kernel.org> <bdfa88fe-13bb-4050-b750-962586b1d846@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368114-linux-kernel-netdev=dewy.ru
From: vadim.fedorenko@linux.dev (Vadim Fedorenko)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks
 under global dpll_lock
Date: Fri, 20 Nov 2026 20:00:27 +0000
Organization: Usenet Network
Message-ID: <ff8b63b7-b943-444a-bd37-b6fb493b5d9f@linux.dev>
References: <20261111164021.273409-1-ivecera@redhat.com>
 <20261116181612.107a4b57@kernel.org>
 <fe1dcdd5-ef75-4231-bf9f-03bf8536c2aa@redhat.com>
 <20261118174424.32e9f130@kernel.org>
 <dd1d61d7-7bef-4a02-8518-e17d2f50369f@redhat.com>
 <20261119133851.3f25074c@kernel.org>
 <bdfa88fe-13bb-4050-b750-962586b1d846@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3251111"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8U5yWjzViBoT7sMj6A+OCJL9KIc= sha256:AkzTNxLz1g22E0U0nTMHwBOTGws+1CcrNkZrhaOQ57g=
	sha1:xvkLZg9LEHlwiTtWCZp5bp8vjF8= sha256:62C3DXx9ML/djgVfxgJvpoVDe+SGQNF3eBR+j1tDiiQ=
Content-Language: en-US
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 71525115A66; Fri, 20 Nov 2026 23:00:54 +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.249,
	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 (1024-bit key)
	header.d=linux.dev
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 IyBXHVWotxjm;
	Fri, 20 Nov 2026 23:00:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368114-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 2D76F115A5B; Fri, 20 Nov 2026 23:00:41 +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 DF8D8E7EBD; Fri, 20 Nov 2026 20:00:39 +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=1795204839;
	b=aKjZ0WXbe2VctMCOQbragfXJ/TK261w6nMxc76F1c2U9+j5nIFv/ETm9DyiKomcf9YFY
	 VHMTQ04d30TGvG1aWCbEPI/Mh/o9l23t5SwPax+Jgc9XTj/ZsnquGsoF/8hp0Wg/bNDZz
	 /iGp3PIlW74kplV8dmmo7muZ0e6gx6C7wsFV1brSPdMmFfPUvF1EefZTBak77JFCchvYg
	 h1USyTXpTn6EyL7HVCCj4+2z5Ez8SePyr9EQawjAUmme+qcHC1/N6gHqLFp79OaAVoMQN
	 qeYTSC3HFj5DxW0oK0PjJCkU5AZ4MX2+RWiRBZYibBRg+KL1rSFDGHXpiosa6nPvkLA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795204839;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=5QgfHDQQ4MSdGh+4Ts8IUMOxAYgDCdzXWqFzljmCVG4=;
	b=TUM/29xXEOCltuCLTGrSwwaaPSWIaA8Cmf9tQ4Y0ftDWiZmFgE+YTi3fnXCBR/gm1f7W
	 vb7u5l2nTCqfMLz2NlhVGbd8xX6GFyvSsWHOKOC9HiKx7Rw2V/FFFzByUS7LiTLXr07g9
	 7FO+wHAQ+wCPxC9dTNZLv7YoUhFBRB7x2mZtIvdcxFJ8xMt/wguiZFHg15McCns4H46y5
	 n2fA9ZCQrNt/zCRUr82d/w/z5ZmGgjqP/K2u2HfHrc8wBfSNZCKG3chxC04AhzBfDgj0Y
	 tZYugloHpyLHuNMlqJNzmYkWPs2ica533nzMLziIdhGc6eJoHGOLc2SbDxsm3flK+oQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b="rKv1/lmr";
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 B75CD606A6F4;
	Fri, 20 Nov 2026 20:00:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=rKv1/lmr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.223
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795204833;
	b=LCsBm0KCAAwJBzgh/6Vp+JF3ZzsChVFuk1G1r6mUHAM9HHHxDgrbGrIay8A3/tzZDXG/
	 JH2FdgUkR0G2awLPsDCpNEcAbRUwc8MjVdj9DzT1p/etvWTnMBIyTVGmbNDVkba2vChGe
	 marXzxP5/i6Nqti1PInyKaYeGH7vSekhriDhtiM8OHgM3Be4tQ7oynibJFCiO9UBTqZ02
	 LERg77ruqMpSruv5ZKBQVLjGeDJLGBh9jhVz8Oqx6z6ABRRlzSce4BqvVacy3FoXtlc8j
	 GUkWsgCb1ZnrPVq8giSAjOz2al35v3mMvyZgSTnjSkzYBbsj73z+hxopT2eB5FsjQIQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795204833;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=5QgfHDQQ4MSdGh+4Ts8IUMOxAYgDCdzXWqFzljmCVG4=;
	b=xZJotGWsP/PcBCR6qIJcQjHxnSVABRSKoyRrvL4fcovmDtKiMACbOBsMkvyls2ry9l5t
	 /BmpZm3HCcSiD8MweX+GM3U3gqJGYgQMiaxudmBeFl5lDOcJhpg83Vny3fOyT3mwqvnFU
	 4+l3YjaAhnYT+ORlP1GoOnLD3SWxCyTxHaIafcFPBcx+z+P8qm8F98C/haemUrRn3+0YB
	 7VeR23I0RX7S4rUEHpchbWyFo/c+NgEgGkgD2JGbd0y/2VXnUAv8EZp6lAU3L5rIwoHWX
	 8wNX+KNx8Cev/Tfsg/1/f3R0QCdYeh1A63WcgUIzp66LV2PxHsi5nXlUw8Vro8tJAhQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b="rKv1/lmr";
	arc=none smtp.remote-ip=91.218.175.223
X-Received: from mta0.migadu.com (out-223.mta0.migadu.com [91.218.175.223])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB7C606A6DD
	for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 20:00:31 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CCB7C606A6DD
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=Uy/t5Hdz2eRHlZ3WuQOUva9nAZPCprYKY2wlV0ZSa2c=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795204829; v=1; x=1795809629;
 b=rKv1/lmrlKj9zRw0pAUymN+J4MTOxMvwQYTxndB1dOU1rJWrKIMU+NNBi1WyHSx8LeZkGin/
 Wfu4rh7M77NTdsuimrihBTU3f5Eoq9ge/dFjldRRX9mkd8G9QYml6H8uE1mVJ46LdnCTAnV0W1q
 csMKFczHRaSNltF7KP9sIiHg=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id b84f8d674bfff41c;
	Fri, 20 Nov 2026 20:00:29 +0000
X-Mizu-Trace-ID: b84f8d674bfff41c
X-Migadu-Flow: FLOW_OUT
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
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
 Shuah Khan <skhan@linuxfoundation.org>, Randy Dunlap
 <rdunlap@infradead.org>, Min Li <min.li@microchip.com>,
 Tony Nguyen <anthony.l.nguyen@intel.com>,
 Przemek Kitszel <przemyslaw.kitszel@intel.com>,
 Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller"
 <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>,
 Paolo Abeni <pabeni@redhat.com>, Richard Cochran <richardcochran@gmail.com>,
 linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
 intel-wired-lan@lists.osuosl.org, Grzegorz Nitka <grzegorz.nitka@intel.com>,
 Karol Kolacinski <karol.kolacinski@intel.com>,
 Saeed Mahameed <saeedm@nvidia.com>, Tariq Toukan <tariqt@nvidia.com>,
 Petr Oros <poros@redhat.com>
X-In-Reply-To: <bdfa88fe-13bb-4050-b750-962586b1d846@redhat.com>