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 03/14] dpll: dpllsim: Add configurable pins
Date: Sun, 29 Nov 2026 10:38:47 +0000	[thread overview]
Message-ID: <179594872729.3146.11707362355260083730@kernel.org> (raw)
In-Reply-To: <20261125090522.3777494-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] In drivers/dpll/dpllsim/dpllsim.h, the comment on struct
  dpllsim_dev::pins and ::num_pins says "Pins in registration order,…

--

dpll: dpllsim: Add configurable pins

This adds configurable pins to the dpllsim driver. Each directory
created under the pins/ configfs group of an instance is a pin with
type, frequency and direction attributes. At live=1 the pins are
validated, ordered, obtained and registered with the DPLL subsystem
after the device.

> diff --git a/drivers/dpll/dpllsim/dpllsim.h b/drivers/dpll/dpllsim/dpllsim.h
> index 0b81bb2f769be..af33afc70cb2e 100644
> --- a/drivers/dpll/dpllsim/dpllsim.h
> +++ b/drivers/dpll/dpllsim/dpllsim.h

[ ... ]

> @@ -27,6 +56,9 @@ struct dpllsim_dev {
>  	 * the live attribute reports, see dpllsim_dev_live().
>  	 */
>  	bool registered;
> +	/* Pins in registration order, valid while @dpll is set */
> +	struct dpllsim_pin **pins;
> +	int num_pins;

[Severity: Low]
This isn't a bug, but does this comment match how deploy and undeploy
handle sim->pins?

dpllsim_dev_deploy() in drivers/dpll/dpllsim/dpll.c sets sim->dpll
first. Only after that does dpllsim_order_pins() allocate sim->pins:

	mutex_lock(&sim->lock);
	sim->dpll = dpll;
	mutex_unlock(&sim->lock);

	err = dpllsim_order_pins(sim);
	if (err)
		goto err_put_dpll;

dpllsim_order_pins() can return -EINVAL before the allocation, for a pin
with an unsupported frequency or a mux pin set as output. It can also
return -ENOMEM when kzalloc_objs() fails. In both cases sim->dpll is set
and sim->pins is NULL until the err_put_dpll unwind clears sim->dpll.

dpllsim_dev_undeploy() has the opposite window. It clears sim->dpll
before it frees sim->pins:

	scoped_guard(mutex, &sim->lock)
		sim->dpll = NULL;

	kfree(sim->pins);
	sim->pins = NULL;
	sim->num_pins = 0;

All current users of sim->pins run inside the deploy/undeploy sequence
under the configfs subsystem mutex. None of them checks
dpllsim_dev_frozen() before walking sim->pins, so nothing breaks at
runtime today.

Should the comment say the array is valid while the device is
registered? Another option is to build sim->pins before sim->dpll is
published.

-- 
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
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 [this message]
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=179594872729.3146.11707362355260083730@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