Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
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
Subject: Re: [PATCH net-next v5 01/14] dpll: dpllsim: Add simulated DPLL device driver
Date: Sun, 29 Nov 2026 10:38:43 +0000	[thread overview]
Message-ID: <179594872350.3146.6237936682428760336@kernel.org> (raw)
In-Reply-To: <20261125090522.3777494-2-poros@redhat.com>

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

  reply	other threads:[~2026-11-29 10:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  9:05 [PATCH net-next v5 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 01/14] dpll: dpllsim: Add " Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko [this message]
2026-11-25  9:05 ` [PATCH net-next v5 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 06/14] selftests: dpll: add pin state tests Petr Oros
2026-11-27 13:39   ` Ivan Vecera
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-11-27 13:39   ` Ivan Vecera
2026-11-25  9:05 ` [PATCH net-next v5 08/14] selftests: dpll: add pin priority test Petr Oros
2026-11-27 13:40   ` Ivan Vecera
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-11-27 13:40   ` Ivan Vecera
2026-11-25  9:05 ` [PATCH net-next v5 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-11-29 10:39   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179594872350.3146.6237936682428760336@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jani.nikula@intel.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox