Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
Cc: netdev@vger.kernel.org, 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, ivecera@redhat.com, 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 v6 03/14] dpll: dpllsim: Add configurable pins
Date: Thu, 03 Dec 2026 15:36:05 +0000	[thread overview]
Message-ID: <179631216590.3146.3449157327076348594@kernel.org> (raw)
In-Reply-To: <20261202153223.2725780-4-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 header comment and the code disagree about how pin->state is
  protected.

--

dpll: dpllsim: Add configurable pins

This adds configfs pin directories under each dpllsim device instance,
each with type, frequency and direction attributes. At live=1 the pins
are validated, ordered by creation and registered with the DPLL
subsystem after the device. Configfs depends are held on the pin items
while the instance is live.

> diff --git a/drivers/dpll/dpllsim/dpll.c b/drivers/dpll/dpllsim/dpll.c
> index c127269fe9a23..8786293dd6d88 100644
> --- a/drivers/dpll/dpllsim/dpll.c
> +++ b/drivers/dpll/dpllsim/dpll.c

[ ... ]

> @@ -39,10 +66,235 @@ static const struct dpll_device_ops dpllsim_dpll_ops = {

[ ... ]

> +static int dpllsim_pin_state_get(const struct dpll_pin *pin, void *pin_priv,
> +				 const struct dpll_device *dpll,
> +				 void *dpll_priv, enum dpll_pin_state *state,
> +				 struct netlink_ext_ack *extack)
> +{
> +	struct dpllsim_pin *sim_pin = pin_priv;
> +
> +	guard(mutex)(&sim_pin->dev->lock);
> +	*state = sim_pin->state;
> +	return 0;
> +}

[ ... ]

> +static void dpllsim_pin_reset(struct dpllsim_pin *pin)
> +{
> +	pin->ops = dpllsim_pin_select_ops(pin);
> +	pin->state = DPLL_PIN_STATE_DISCONNECTED;
> +}

[Severity: Low]
This isn't a bug, but the locking comment on pin->state in dpllsim.h
doesn't match how the field is accessed here:

	/* Simulated state, guarded by dev->lock */
	enum dpll_pin_state state;

dpllsim_pin_reset() writes pin->state without dev->lock. It is reached
through dpllsim_dev_deploy()->dpllsim_order_pins() after sim->lock has
been dropped. The reader, dpllsim_pin_state_get(), does take dev->lock.

As far as I can tell there is no race. Every other access is a dpll pin
op callback, and the dpll core runs those only for a registered pin and
under dpll_lock.

On the first deploy, the reset runs before dpll_pin_register(). On a
redeploy, it runs after the previous undeploy called
dpll_pin_unregister(), which takes dpll_lock and so waits for any
callback still running.

Could the comment say that the field is written without the lock while
the pin is unregistered, and under dev->lock once it is registered?
frequency, prio and phase_adjust follow the same pattern later in the
series, so their comments may need the same change.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202153223.2725780-1-poros%40redhat.com

  reply	other threads:[~2026-12-03 15:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 15:32 [PATCH net-next v6 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 01/14] dpll: dpllsim: Add " Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko [this message]
2026-12-02 15:32 ` [PATCH net-next v6 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 06/14] selftests: dpll: add pin state tests Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 08/14] selftests: dpll: add pin priority test Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-12-03 15:36   ` 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=179631216590.3146.3449157327076348594@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@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