πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24118

Re: [PATCH net-next v5 01/14] dpll: dpllsim: Add simulated DPLL device driver

#24118
From: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 10:38
102 lines
11370 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 comment on the `registered` field in struct dpllsim_dev
  (drivers/dpll/dpllsim/dpllsim.h) says the flag is "True while the…

--

dpll: dpllsim: Add simulated DPLL device driver

This commit adds dpllsim, a driver that provides simulated DPLL devices
for testing the DPLL subsystem without real hardware. Instances are
created through configfs, and writing to a live attribute registers or
unregisters the device with the DPLL core. The device registers as a PPS
type DPLL with only the mode_get and lock_status_get callbacks.

> diff --git a/drivers/dpll/dpllsim/dpllsim.h b/drivers/dpll/dpllsim/dpllsim.h
> new file mode 100644
> index 0000000000000..0b81bb2f769be
> --- /dev/null
> +++ b/drivers/dpll/dpllsim/dpllsim.h

[ ... ]

> +struct dpllsim_dev {
> +	struct config_group group;
> +
> +	/*
> +	 * Set from the start of a live transition until the device is
> +	 * undeployed, written under both the subsystem mutex and @lock.
> +	 * Freezes the configuration, see dpllsim_dev_frozen().
> +	 */
> +	struct dpll_device *dpll;
> +	dpll_tracker tracker;
> +	/*
> +	 * True while the device is registered with the DPLL subsystem,
> +	 * written under both the subsystem mutex and @lock. This is what
> +	 * the live attribute reports, see dpllsim_dev_live().
> +	 */
> +	bool registered;

[Severity: Low]
Is this comment accurate? The flag does not seem to match the DPLL core's
registered state exactly.

In dpllsim_dev_deploy(), dpll_device_register() sets the DPLL_REGISTERED
mark and sends the create notification. The flag is set only after that:

	err = dpll_device_register(sim->dpll, DPLL_TYPE_PPS,
				   &dpllsim_dpll_ops, sim);
	if (err)
		goto err_put_dpll;

	mutex_lock(&sim->lock);
	sim->registered = true;
	mutex_unlock(&sim->lock);

In dpllsim_dev_undeploy(), the flag is cleared first. Only then does
dpll_device_unregister() send the delete notification and clear
DPLL_REGISTERED:

	scoped_guard(mutex, &sim->lock)
		sim->registered = false;

	dpll_device_unregister(sim->dpll, &dpllsim_dpll_ops, sim);

dpllsim_dev_live_show() only takes sim->lock. In either window, a reader
can see live as 0 while a netlink device get still lists the device.
Later in the series the flag is also set after the pins are registered,
so the deploy window gets longer.

The changelog says this ordering is intended:

  "it turns 1 only once the whole live transition succeeded and 0 again
  as the first step of the teardown"

So the code looks fine. Could this comment, and the "Live means
registered with the DPLL subsystem" comment on dpllsim_dev_live(), say
instead that the flag means the live transition has completed? That
covers only part of the time the core has the device registered. The
later patches in the series leave both comments unchanged.

> +
> +	/* Guarded by the subsystem mutex */
> +	u64 clock_id;

[ ... ]

> +/* Live means registered with the DPLL subsystem */
> +static inline bool dpllsim_dev_live(const struct dpllsim_dev *sim)
> +{
> +	return sim->registered;
> +}

[ ... ]

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com
Technical Details
Message-ID: <179594872350.3146.6237936682428760336@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-373449-linux-kernel-netdev=dewy.ru
References: <20261125090522.3777494-2-poros@redhat.com>

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-373449-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 01/14] dpll: dpllsim: Add simulated DPLL device driver
Date: Sun, 29 Nov 2026 10:38:43 +0000
Organization: Usenet Network
Message-ID: <179594872350.3146.6237936682428760336@kernel.org>
References: <20261125090522.3777494-2-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1150008"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XEg5+edDidRulDG3Af4fZB5+FTw= sha256:ZXIPkFn3Yvp/YykGcHN/ZmNBPLWZSKadMGWE6zikXZY=
	sha1:mS452sbQPo6nxUQTZblvnUyCIBo= sha256:EWAUtiSAUfFqY8Y847w9W5BT+qIgPiO2PoQWdhu89kw=
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 13654125F9A; Sun, 29 Nov 2026 13:39:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 19-Je15bt4CW;
	Sun, 29 Nov 2026 13:38:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373449-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 29FFB125F96; Sun, 29 Nov 2026 13:38:47 +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 84872250CC; Sun, 29 Nov 2026 10:38: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=1795948726;
	b=2UUb4ZSKJA/wfalW07LTVQHVkmxZDcMBKhk+y3qYhNmk8pv4WnPb4pZ7xYkT2pcMpgdE
	 aIPvR6FPGYyARmQWlXUcXcOe8IEimJUTpHKETiit8Vb3nSymBqtA4Wm09QkNin879yUB5
	 CIT7Sc1qd19ZRUlFqOqGHtRxLXFUHUTQ5pHpdj9ocbVqpZSRY3F5bd0TyB5rzOZMVxZkk
	 zttLRLFGZvsxHnTi9Bs/WDGSkDbSvBGo7muOU1yLmSWI3Etf3OhEJPHUl1ueY5GEFQATU
	 m/pBFHMU6SRvl/aDMviGdCEvVqdJYjZnzPdB+FbynMNTKI0nCN6iE5xEuL2ZcHJNI3w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795948726;
	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=bfGX8KjlUCAbjl9E5dszZ2dOTKXE8RWl3yEfjDXMGD8=;
	b=iBdvDDvIhEBnPJsd1GyMVd++FMDT+4qKdXawBEy2UfTZREJRLlX3cieWvgwMQwlwEAoa
	 +Fe3pMF5YVjsh1VtuhnayciZAgM+9EdimKDdMY64lBmlK8uJrEGYvnvtBpYDo5P3prgbp
	 AoGWxBEPZqFl8NHz0fPSwYBAkAAVlYiwVl7xF0ScxS6VkLRflHtAMP7eDDcrw113cqP4Z
	 8SmzY/afDjEF6qNGYJn4WZy3fggOEKld3KmdMlvv/YwMsCw8mTAV8Wtnzz7P8wg7pNqPV
	 VHCgBE2AiQ/onb5GdHTG2HfQH9WoFZogCSFQQfRQ7Co3gprVD6j9G9DLyYmkSrE4HmA==
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=G8Gy4TJQ;
	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 5C9D6606A330;
	Sun, 29 Nov 2026 10:38:46 +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=G8Gy4TJQ
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=1795948725;
	b=sSc4BIBIeRj9iJ+iNNRnhB1gvBRmvCjXTjyaFyV6LB33JbCrO2RTuorIvNwikT0d/TS8
	 gu6h1/g7P+/uwkASX2DNjfJYAXCgpWV2Okxw4txZHxYbCFgTwJbv0pGgIgsaCSr4/gKyf
	 K6RiD6Zl/jDoRYwRa4WlPvTJzj1Pt2VwgGIFgHRud+6kPdLKfGDv/t/m+zsaS6cQN0UBq
	 iDNU0diw9S7SijZqKNpX4poPXxHlG+kV6K7Gez14eRh2XyAck2NHXl7A+7iG4YtDaNk/n
	 R+bnrsZctvySZI7p/hprTjfjwUMcse1l062U/Mrvcx19i4CaZPX+lZqajYydhDK9W9w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795948725;
	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=bfGX8KjlUCAbjl9E5dszZ2dOTKXE8RWl3yEfjDXMGD8=;
	b=Zsln06GE56dPu+DjvmSoe8aGdnHgdgZhrv6vAe8VtT/g6paMwUh7lyfVQznaPdTnpN7B
	 EB1Au1gEjAho3zEMaMj2OjMJ+PoAdGK6g8F9wuli5JIRjidgJ12wqoUXz4/ogF6ogOgb6
	 XmmSDH3H728aPBKqbdFRBgNUS95lOVxx+W5aOr4LBS0l/SxeXYZ0veffpYYbtLGh4HKJh
	 jyz8kwSAmXSH78KqYSl5fj3S/cEUmZwoihl6BHG3iOz3iFci4n1AM6kE8cDN+udShMP3A
	 y2WiuPjVTMJqYOTBFeQ3EVeHVkcG6WkBwtfPow6ru6tZIYCId6SoxOlgjNvNLro8tFg==
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=G8Gy4TJQ;
	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 7AD33606A323;
	Sun, 29 Nov 2026 10:38:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 097C31F00897;
	Sun, 29 Nov 2026 10:38:43 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795948725;
	bh=bfGX8KjlUCAbjl9E5dszZ2dOTKXE8RWl3yEfjDXMGD8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=G8Gy4TJQBy7LDKoI88lj4u+tmpKazKtJLtElWvdbQT2qVzGXkgGas1wuXI5yYrNOC
	 BxrVLd64EgQzaQiUpLC4fI2zRTBRqm1kCOKJhRQlAEsaFvvNwDK2P5TLJxkgDtTqxd
	 j2tk/Mc90xtm2zeoterAbZZLRkhoS8TLxVI8kX7+E/lsFQzKvfuhR2sYPCqNkdrqBA
	 3hh+fAWPjAh86nYHtN4QrPZaFOC4BY+z3deMHCza207TmP45gPWtfaE6dQD1sUzNpZ
	 MuLK+I9bC34sVGiM7OtJXG6Oy5npA4GgDlngS5yfS4uVjYilpYHyL4i4NleCA8YH9Y
	 L5MoQIDTUpLkA==
X-Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com,
 corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org,
 rdunlap@infradead.org, jani.nikula@intel.com, vadim.fedorenko@linux.dev,
 arkadiusz.kubalewski@intel.com, jiri@resnulli.us, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <20261125090522.3777494-2-poros@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