Article View: linux.kernel.netdev
Article #22991Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks under global dpll_lock
From: David Laight
Date: Thu, 26 Nov 2026 09:15
Date: Thu, 26 Nov 2026 09:15
102 lines
16410 bytes
16410 bytes
On Wed, 11 Nov 2026 17:40:11 +0100 Ivan Vecera <ivecera@redhat.com> wrote: > dpll_lock protects topology and object lifetime, but it also serializes > all driver callbacks in the system, so one slow device stalls every other > DPLL device, whichever driver it belongs to. mlx5 callbacks issue firmware > commands with a 60 s default timeout, and zl3073x callbacks can wait > seconds on a driver lock held across ToD writes and phase steps. > > Make dpll_lock an rwsem for topology and lifetime and add a mutex per > domain for callbacks. A domain is all objects created with one (module, > clock_id), in practice one chip or card, so channels of one chip stay > serialized as drivers expect, and they still block each other. Device > callbacks run under the domain of the device, pin callbacks under the > domain of the pin, whichever driver registered them. Only one domain lock > is ever held, so domains have no lock order. A lock per device would not > work, because pins are N:M with devices and callbacks notify sibling > channels. > > The driver API does not change, but a callback can now notify only > objects of its own domain. Patch 1 changes the one in-tree callback that > does not follow this. > > Registrations across domains exist in the tree only on E825, where ice > registers fwnode pins of an external DPLL with its TXC and TSPLL DPLLs. > These callbacks are no longer serialized with TXC and TSPLL, they rely on > pf->dplls.lock, and requests about these pins wait while the external > DPLL is busy. Intel folks, please check that this is fine. Isn't the big problem with callbacks handling deregistration? With a global lock there isn't a problem. But as soon as you do anything else you have to have very explicit rules to safely deregister a callback without either a UAF or an ABBA locking issue. I don't see this being mentioned. David > > Each complex of a dual complex E825 has its own DSN and so its own > domain, but both use the CGU of complex 0. The lock for the registers > they share is in a fix sent to net [1], which this series needs. Without > it a test lost updates of them. > > Patch 4 is the only patch that lets callbacks run concurrently. Patch 5 > adds KUnit tests. I also tested each commit with a mock driver and YNL in > QEMU, with lockdep and KASAN, and the tip with lockdep on two systems: > > - A board with ZL30732A: every notification the driver sends from a > callback, concurrent traffic with PTP, driver reload and rebind. > - GNR-D with dual complex E825 and zl3073x: callbacks of the pins shared > by both drivers, TX clock switches, RCLK pins of both complexes, a port > going down and up, and both drivers unloaded and loaded in either order > under load. > > mlx5 is build tested only. > > On GNR-D, with ToD writes running on the zl3073x and requests waiting for > them, requests to an ice DPLL took 1448 ms in median and 3.9 s at most > before this series, 0.2 ms and 0.3 ms with it, the same as when idle. > Requests about the pins shared by both drivers still wait for the zl3073x. > > Changes in v2: > - Dropped "ice: dpll: serialize changes of the SyncE CGU registers", sent > to net with a fix of the SyncE divider [1] > - Addressed the Sashiko review, see the patches for details > - Added Reviewed-by tags from Petr > > v1: https://lore.kernel.org/netdev/20261106121005.1327603-1-ivecera@redhat.com/ > > [1] https://lore.kernel.org/netdev/20261110094350.184185-1-ivecera@redhat.com/ > > Ivan Vecera (9): > ice: dpll: notify TSPLL lock status from the periodic work only > dpll: add domain object > dpll: take domain locks around driver callbacks > dpll: convert dpll_lock to rwsem > dpll: add KUnit tests for core locking > dpll: reject measured_freq_get for foreign and on-pin registrations > dpll: zl3073x: update locking comments > ice: dpll: update locking comments > dpll: document locking rules > > Documentation/driver-api/dpll.rst | 48 + > drivers/dpll/.kunitconfig | 5 + > drivers/dpll/Kconfig | 13 + > drivers/dpll/Makefile | 1 + > drivers/dpll/dpll_core.c | 204 ++- > drivers/dpll/dpll_core.h | 34 +- > drivers/dpll/dpll_core_kunit.c | 1580 +++++++++++++++++++++ > drivers/dpll/dpll_netlink.c | 117 +- > drivers/dpll/zl3073x/dpll.c | 9 +- > drivers/net/ethernet/intel/ice/ice_dpll.c | 24 +- > drivers/net/ethernet/intel/ice/ice_dpll.h | 5 + > 11 files changed, 1919 insertions(+), 121 deletions(-) > create mode 100644 drivers/dpll/.kunitconfig > create mode 100644 drivers/dpll/dpll_core_kunit.c > > > base-commit: 368fbf5d82da9ebce309449c74fc0b128f7d0219
Technical Details
Message-ID:
<20261126091510.7ac67b35@pumpkin>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-371988-linux-kernel-netdev=dewy.ruReferences:
<20261111164021.273409-1-ivecera@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-371988-linux-kernel-netdev=dewy.ru
From: david.laight.linux@gmail.com (David Laight)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks
under global dpll_lock
Date: Thu, 26 Nov 2026 09:15:10 +0000
Organization: Usenet Network
Message-ID: <20261126091510.7ac67b35@pumpkin>
References: <20261111164021.273409-1-ivecera@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="424682"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Cju1/hQG7KE1jzyzPSD8Q4fgA0M= sha256:BVkzjZqgjRwzaj3FG1PmdRnh6PNSuZeeLmNehJW3tOQ=
sha1:y7pY9CQJuKWqwk015tcCv3K76AQ= sha256:qWh/IZQFSOG35nSolSCRXWGRnml2HgYbvKfRpPE5lXE=
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 6CC5D125EBC; Thu, 26 Nov 2026 12:15:32 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.149
X-Spam-Status: No, score=-2.149 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 uqgCZjcStOT6;
Thu, 26 Nov 2026 12:15:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371988-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 3D9E1125EBA; Thu, 26 Nov 2026 12:15:19 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 8E23C360AB; Thu, 26 Nov 2026 09:15:16 +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=1795684515;
b=cLZJ2/gUh0jNezUe8hbNGH43lDh/Bmxoc2pnFheRi4lEcfhZqOukvsx4MXTx72WEX5mf
bx/i8AKlmvTwVwlMTB+r1OyKqp0l5e7/JLWaguUTx4AAJ7HNQXoCXuzchnnlKvpwvYz09
rltSJMb1vVnQdua3zu+qM94UomtR6iCIyihDwxNP7hbztQld2v4GZN4/9iTmqxXOMw49X
SwCSwhaWqQl8S10OS99Bkrh1bAc2v4gEUS7W0621pu2HnHSbtz2AZpERFz2UQYzV9blPu
i55qPIiys3oFADKBWd+463AFQJQSDAhFFWuLjyDx/rV/FDl5Z9F93x5UqTaZVIc96qQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795684515;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Transfer-Encoding;
bh=nOvBGWrpieXjeYeaYeQ4iz+dQ3K5Ruh6yQGDubq0gG0=;
b=m1ljcSfujqZ2iCYYAHuEvVm81L0KbDK9kBh/77R+9qkTaMLFmfp1EUhGXSMzDcubpqXj
EBtV3w3JUYHa36Ynyg8DCHnSlTP2XaQ/zOe+IFvM8M3sDabA+HALZ0Nnr09vsfDIgzN5x
+g3sAx/jB8x+Hgk1mgwRtb/aFSXGmZFEtw7I2dG/GWfXid2bw4TB4CQTbLbouDxQjf2So
PVcZkmhs4mo9o3VaNlRokeVMahcTBAnpaUW13CllMEIMC8yFux5Zx+6fEq2pmfZ4nS8U1
Nmq42V+/efa9kbPv0kGFCrfjbilHZqVpXs0JyMjGvxRLUDBePRCeEaZ4evp9qErSScg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=c1eo+N4W;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 3657D606A337;
Thu, 26 Nov 2026 09:15:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=c1eo+N4W
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795684514;
b=hbPHe0/IsoAScBy3TsBj4yOBKFRSemvjaNZGxYQ9QeFEZIZkwesq5DuumdUMEsTrPtjo
jryqITwbyegNZzOvU8KYtD2hHDL0VEUDBKItK/T1u8njB7rpLHaoRa4+dnapjRXpPYtIW
4OwYGsoQBYUyga5N6/cTomwnhkeRx+Tbs7tlC3Oms1CRFi9nu1QY3vPz450jb1VpSm3nG
MOv1vTjTDXRk7cqPuIUybHjke3rvZnzxcoGLfmuB4H0XGfX5nPDWg4FKUuZkkq0D4a5bw
Z4yT/0HWzUhS1X9XvXrcuJm04+gW2n+vVBOFBRilwLT4EfJF8NGbl3M4FBfy9izGoCQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795684514;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc:
Subject:Message-ID:In-Reply-To:References:X-Mailer:MIME-Version:
Content-Type:Content-Transfer-Encoding;
bh=nOvBGWrpieXjeYeaYeQ4iz+dQ3K5Ruh6yQGDubq0gG0=;
b=fTyHX80DnClPtOYqresBLkDS97lueGkR1PwOJjwqhxHdT2DTXGWJuGHq46CVLUdyhRbs
36MjTe0fB4J2KwLoeaIgPjScchQxCk0hvn3VozRnsm+4KesONyAOJayYuLGqNbzRwtwHi
OYiEfaBrTswgbmJ0MmsbDWcsjU4G3ch4xkycZqTCxoAlsqHgpAAI+E2mGjAfgkwrwi8DT
LKrRs73mLDMc0pfMB22AXyV0EKmEEer7sLtgxKQ7CGzNHVav6x/+1UV1Qjb1Sx42MbfLJ
X4lz4jBiiOlVbgT5bT6pWS9RicyL1C5Ixrj6l528d8L+0np5s9QxSm/NQ7QFonUjXIg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=c1eo+N4W;
arc=none smtp.remote-ip=209.85.221.51
X-Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51])
(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 07F09606A321
for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 09:15:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 07F09606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a3e706b5dfso4172870f8f.2
for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 01:15:13 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795684512; x=1796289312; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:mime-version:references
:in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=nOvBGWrpieXjeYeaYeQ4iz+dQ3K5Ruh6yQGDubq0gG0=;
b=c1eo+N4Wiv7EjKxwfcL3tfFeqHu8x6Krnvw93i6u/jfF+sGc2puye5EC9fpm2hHm1y
fDnPfexBgEGfMjM7yd2zgZdeG0kXNj/pJAQKzYVw85wcUfnVroYZ4LnFf5d3XZ/Hv+et
1W7P3Rigw2cYBsDwlqtzjOLuiE3LksmY9qibSpKVPbmGoMONoBR+FKIvmzf2IGbeBtlX
LV/KklZVuZLt7eJDYLih0Yky1NMgailveCaxPt2g4YN8gNC8BObSJB3ml6e0M+688hle
bflyxMYc4YeEGyPXz4l2LwullUHtEyF4tGS9y1EHOuIJzjQM31WoHbD79J5yLXPq36gm
260Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795684512; x=1796289312;
h=content-transfer-encoding:content-type:mime-version:references
:in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=nOvBGWrpieXjeYeaYeQ4iz+dQ3K5Ruh6yQGDubq0gG0=;
b=WQG8XzSoSv2lRUw04GQlsiNEpoPEzmBVJllN8jaYw4odSNVyw/WUNQxAwJWlPomGFW
5Y9m7uZowef1RF6lcqDJgHcuWzxJgY7oRKwVA3n8syfldT6v/+HybtiZ4rXWpBZ7AVpI
aWF86Q92SXtFwQdT1d5T9pwaegA4UD380o5HmSJIclPy76WhkUHOluYihC9kFbtKPHZS
ZLiic6a5UyIVo5l0bns+NgaiuQOhgxbl5KLFVnkOK1i3S8ICJXXSQiS0w09i7+ALGKrD
GdM7JnlZDRiw0wrmZdhyRptGSisIJE9Rop93Xy0xMq5iTdLsZfAnt5CO5cZwukyifJnz
0uNQ==
X-Gm-Message-State: APuU4Z9MTtU5iZxDf1scTw6T/Tbz+1+IMoRw1p0BNjJRaYhhgEMgv5wU
ggFCw4Ygkg9Pta7OGEEbjonS+C5PGDjaTsxOfQMrY7q8WeDWo+j6kJ7W
X-Gm-Gg: AZFdTZeN0QExe1vOa8nd/XgA5qxNEswyUZIFogjUcmPQFfLq6yz+fWINjNRIjdToWKM
HpazpY4VXKRVAeQgSqu0JTAzCtj+p4T0gnHqXd7yOmr9toeU74rGbFHCav23VqI7ynJN3NnYY54
9F1lZwT9Stf+QTO0zQqoepSSHwdNtIwyqOJBscuGvHVaZ6pa0kHpSAzz+kjebKZm6i2mdllXNwP
YXWdJ5W+IMmcNzUR4pxYsCg/DQjJbqiFXxt+qF1y547sOWeQDu+XSp5jxJqPqIdluXnht/mcrUp
QVmEy9/mvloDWASpMyWRkLrOsEs37r+cpkW44hVXL57ahOxZkFu5Q01lUv5WZixi+kaw61XIyMZ
JGl881vB4vj9R50Inu65bfYAvs2oEDcawiwtFiP/RNJNTfWKypccoBbugk/X6dYghx0FHhr5eHa
jxwN99+1k7e6PgWf4aHbMF4dxkmEELAhVnypC2FZFEk4Zy3FBdqEjQwpEvGHd1/M9DUvqcpPzHa
lvv058T0IZF/XfMWgG60sYpQjkqmoEjbqvRqdDG0ta7/T88bYOETFNGFexZqNS4zzMP8eM2d+Ax
A/6g//Jr91ALjUNHGpQjZDGajVcLRvdQ4OJ8gwxe8D+fkIl9jjYGjb7DKe2DKb++0Hs=
X-Received: by 2002:adf:e009:0:10b0:492:b1c5:6db4 with SMTP id ffacd0b85a97d-4abb4c7ab68mr28124075f8f.26.1795684512114;
Thu, 26 Nov 2026 01:15:12 -0800 (PST)
X-Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b10b5f6sm37029320f8f.34.2026.11.26.01.15.11
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 26 Nov 2026 01:15:11 -0800 (PST)
X-Cc: netdev@vger.kernel.org, Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>, Jiri Pirko
<jiri@resnulli.us>, 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>, Jakub Kicinski <kuba@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: <20261111164021.273409-1-ivecera@redhat.com>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf)
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