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 03/14] dpll: dpllsim: Add configurable pins
Author: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 10:38
Date: Sun, 29 Nov 2026 10:38
76 lines
10468 bytes
10468 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] 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
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