Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Sun, 29 Nov 2026 10:38
Re: [PATCH net-next v5 01/14] dpll: dpllsim: Add simulated DPLL device driver
Author: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 10:38
Date: Sun, 29 Nov 2026 10:38
102 lines
11370 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads