Article View: linux.kernel.netdev
Article #14139Re: [PATCH net-next 05/10] dpll: convert dpll_lock to rwsem
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 17:53
Date: Tue, 10 Nov 2026 17:53
89 lines
11259 bytes
11259 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] This patch turns dpll_lock from a mutex into an rwsem.
--
dpll: convert dpll_lock to rwsem
This commit converts dpll_lock from a mutex to an rwsem. Core functions
that change the topology take it for write. Netlink requests, dump parts
and change notifications take it for read, so callbacks of different
domains can run concurrently.
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index dd09f52817099..8eb7468234315 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -19,8 +19,12 @@
> #include "dpll_core.h"
> #include "dpll_netlink.h"
>
> -/* Mutex lock to protect DPLL subsystem devices and pins */
> -DEFINE_MUTEX(dpll_lock);
> +/* Protects the topology and lifetime of DPLL devices and pins. Taken for write
> + * to change them and for read for the whole netlink request, part of a dump or
> + * change notification that uses them. Driver callbacks are serialized by domain
> + * locks, which are only taken under this lock.
> + */
> +DECLARE_RWSEM(dpll_lock);
[Severity: Low]
Should the assertions in dpll_domain_get() and dpll_domain_put() be changed
to lockdep_assert_held_write() along with this conversion?
Both helpers still use the plain form:
drivers/dpll/dpll_core.c:dpll_domain_get() {
lockdep_assert_held(&dpll_lock);
xa_for_each(&dpll_domain_xa, i, domain) {
if (domain->clock_id == clock_id && domain->module == module) {
refcount_inc(&domain->refcount);
return domain;
}
}
...
ret = xa_alloc(&dpll_domain_xa, &domain->id, domain, xa_limit_32b,
GFP_KERNEL);
...
}
drivers/dpll/dpll_core.c:dpll_domain_put() {
lockdep_assert_held(&dpll_lock);
if (refcount_dec_and_test(&domain->refcount)) {
xa_erase(&dpll_domain_xa, domain->id);
mutex_destroy(&domain->lock);
kfree(domain);
}
}
On the old mutex, lockdep_assert_held() checked for exclusive ownership. On
an rwsem it also passes when only the read lock is held.
Every current caller holds dpll_lock for write: dpll_device_get() and
dpll_pin_get() via the alloc helpers, and dpll_device_put(), dpll_pin_put()
and the register/unregister paths via the __put helpers. So this is not a
runtime problem today.
However, the read-side holders added here (dpll_pre_doit(),
dpll_pin_pre_doit(), the dumpits, dpll_device_change_ntf() and
dpll_pin_change_ntf()) can now run concurrently. If one of them reached a
domain lookup-or-create, or a final put, lockdep would no longer warn about
the race on dpll_domain_xa or on the domain refcount.
call_dpll_notifiers() can keep the plain lockdep_assert_held(), because it
legitimately runs under the read lock.
These assertions are still unchanged at the end of the series.
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106121005.1327603-1-ivecera%40redhat.com
Technical Details
Message-ID:
<179433320479.994134.13826920591104367019@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360494-linux-kernel-netdev=dewy.ruReferences:
<20261106121005.1327603-6-ivecera@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360494-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 05/10] dpll: convert dpll_lock to rwsem Date: Tue, 10 Nov 2026 17:53:24 +0000 Organization: Usenet Network Message-ID: <179433320479.994134.13826920591104367019@kernel.org> References: <20261106121005.1327603-6-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="686058"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:r9mmThNiC40VS61zKBjJU+oov6M= sha256:AAfDH6z4H0wsosvyugubKeMUsLh3UGAaAsa/OMaM2uc= sha1:L4ycy8LqZ6XnNyMpO2dVVEnC4rc= sha256:L+b/DEe9rnyVs4SJ9NsiajghNTKwkCkjHHBt/Kz/1zI= 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 7F89E113CEC; Tue, 10 Nov 2026 22:39:54 +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 xzlNw2zx2JEK; Tue, 10 Nov 2026 22:39:50 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-360494-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 92548113CDA; Tue, 10 Nov 2026 22:39:41 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 737491A7A52; Tue, 10 Nov 2026 17:55:08 +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=1794333223; b=UM/t+VPJeSMCLBY/MlMeOfs2OfSm8eDE6IdAU84Gl5J9RjMzYE9EzlsafrGys9cVIibO vpjhgTlIS9wxDr0PDUpjoxGiXd9qXzZ8TfFRR70wWkORePlFouI59ytIkzXVxV5eYDOIt gConWooochL/HKcOlU677d6jVG3QEXsKspO/9JEO6i0yv6ddEoDISdx+05HX4irg0VjZw TUi32IwwTf5rl1g+MBa05aHK82VT5I1ivOopS23xjPogSwEWIZGg7ebUlk9zZwq8wjv0r A8b4uPbfMV9etFYlDM3G25MkO1UJrmxzVguJzWqcCLwfeJAWQqFtPHGQMOrQ+KRqnCg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794333223; 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=ebrgguzYZNPO98ahlAUGmK5SoDtGwXJz8Q3pxsxvEgw=; b=KPYGo2dmZKuNU3thP9xatcYG7rvR7em+An2wcIbgeijelsubTJ9qRL6FBU1asr7PdDLB Fjsenbw321e3yViSBLeOEsy+tVIWB/vot1rXP1wW7vrhESessrXjj151ed47WrBK9uAGn E0DeqvdZ/RJXn8UrXcBOW+hrKy0DtIepmUA1TilrhnkkMAD4jc/WRTq0uqmorO22PjjVX GG8rjBz35aWlsyiH0bn35Y4h5OlX9MlNXzAgjgxCRuh7t8Yxfe3Lwwbru9UVX8KkD6IBt gmzmOYdtRWlx3wYImrWnQhlMiN+HcIE9LHJQKNro8w22drg1MDqRZyWoYPg1fqDXYZg== 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=Rpi8Epj2; 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 0693060A6F75; Tue, 10 Nov 2026 17:53:43 +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=Rpi8Epj2 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=1794333207; b=svGuYVVsPFWgXLBGzXxKLf96abK6akcMD6SK5JVfs99nSHYLzjyd+Bs4hwi/uXHOrmf/ O/jJWmrydmuBXk+TYnkuyVTDKqmx8IIJ5kNh5mBTOaCOMkI3xMnkh3zdVBkH5dLDLr6Xc REgtoGAno/vQgwVs/9aZ7P5JAzjJBtH2Uu6pW3wDhbG7KB8sEd1ejYU1F+f+0NKEjIBDn jvP99Ea8S8hFc8MXA6f/Ukoz1zOXZxkSPZUH7Dww54su0lFWreoSdMaCtNYdQ/VCUzllG gORJFUlFIz5P6UrUBt2/C1CdRGO3LOKRjN0YcpfsmB2wpZNWbNBorWZa8FtQNhSVI3g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794333207; 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=ebrgguzYZNPO98ahlAUGmK5SoDtGwXJz8Q3pxsxvEgw=; b=Jmhe+y/BBx7wKErlfOZJjg4b1WjAQkWnaCGUvtJflfDxJ9+syt/grBor0X3K7HZxUCCh vG8n0BEn4hhROxZ8epyqhF3+pqZ4pBUa9X6wtBYpFz4QrPNy6Xi/5Xb24hysJgFVuzy+9 m+YUfsRJ4p1k6y/jJ8iTbtEgfvT3YV9WFLGZvGZ3qkJIkI4Nup74s7fCSf44WVy4lSm5h 6/VR/zlLkcR9pYO+ZHiR4+BPokIwH8f7/jUSrw0GuJNcz+A4NCr60XV1RMcnV9eZdqcn3 5AKSafWpOH5PLWG4rajnluY+Yeq21DAaaMh4+lUTx7G/e59kTIADCWl1YclYUaoU8/g== 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=Rpi8Epj2; 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 B850860A262E; Tue, 10 Nov 2026 17:53:26 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CD211F008A6; Tue, 10 Nov 2026 17:53:25 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794333206; bh=ebrgguzYZNPO98ahlAUGmK5SoDtGwXJz8Q3pxsxvEgw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Rpi8Epj2hAbMGS9noZ90k0oah0cdappeJZcbQPqArf6F1P6oyjOuB9F19VFsQBRqI BTDRBmrLMRK59Px5MifpXTi8+0nYI9q+6dud24HN6qd9SBTEYVCJB8VRdrioJdL3/J m2TB8nqYGRQ8s+VhX2kSTnU6PP8CFdF2STZur3jU5W5CT1U9wYVnGBV6WS9AvinRf9 5iE0W4OQsMw7Nl3GYZnFsrHZZoOveKiMm5G0BqqOmxhegLnLSCRL7ok/Up0BuA3zGV i6MhyM0WSzoHyek3oJXGyGAso/leIDGchY8lLvyzCsywGpY/hr6Qej17ir1eWmJdF5 X6HN1Av2KZCJQ== X-Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, jiri@resnulli.us, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, min.li@microchip.com, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, grzegorz.nitka@intel.com, karol.kolacinski@intel.com, saeedm@nvidia.com, tariqt@nvidia.com, poros@redhat.com X-In-Reply-To: <20261106121005.1327603-6-ivecera@redhat.com> 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