All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ali Rouhi" <arouhi@sitime.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v13 05/12] dpll: sit9531x: register DPLL devices and pins
Date: Wed, 14 Oct 2026 22:41:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-171990@kernel.org> (raw)
In-Reply-To: <20261013224131.27149-6-arouhi@sitime.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] build: undefined macro kzalloc_obj causes compilation failure
- [Low] locking: sit9531x_chan_state_fetch called without required multiop_lock
--

commit 5f5cba1ccd97d6786f10dd67578b1b35e4e746e8
Author: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
Subject: dpll: sit9531x: register DPLL devices and pins

This commit registers SiT9531x PLLs as DPLL devices and exposes their inputs
and outputs as DPLL pins. It implements device and pin structures, initial
hardware state fetching, and periodic polling for state changes.

> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> --- a/drivers/dpll/sit9531x/core.c
> +++ b/drivers/dpll/sit9531x/core.c
[ ... ]
> @@ -934,22 +934,17 @@
>  	for (i = 0; i < sitdev->info->num_outputs; i++) {
>  		/*
>  		 * Nothing runs concurrently before registration, but the
>  		 * output fetch walks paged registers under the same contract
>  		 * as at runtime, so it holds the lock the same way.
>  		 */
>  		mutex_lock(&sitdev->multiop_lock);
>  		rc = sit9531x_out_state_fetch(sitdev, i);
>  		mutex_unlock(&sitdev->multiop_lock);
>  		if (rc) {
>  			dev_err(sitdev->dev,
>  				"Failed to fetch output %u state: %d\n", i, rc);
>  			return rc;
>  		}
>  	}
>  
>  	for (i = 0; i < SIT9531X_NUM_PLLS; i++) {
>  		rc = sit9531x_chan_state_fetch(sitdev, i);

[Severity: Low]
sit9531x_chan_state_fetch() explicitly invokes sit9531x_prio_table_read(),
which is documented as requiring the caller to hold sitdev->multiop_lock
to protect paged I2C register accesses.

Is it intentional to omit the lock acquisition here? The adjacent loops in
this initialization sequence acquire the lock before calling the state
fetchers.

>  		if (rc) {
>  			dev_err(sitdev->dev,
>  				"Failed to fetch PLL%c state: %d\n",
>  				'A' + i, rc);
>  			return rc;
>  		}
>  	}
>  
>  	return 0;
>  }
[ ... ]
> @@ -1338,15 +1338,15 @@
>  static struct sit9531x_dpll_pin *
>  sit9531x_dpll_pin_alloc(struct sit9531x_dpll *sitdpll,
>  			enum dpll_pin_direction dir, u8 id)
>  {
>  	struct sit9531x_dpll_pin *pin;
>  
>  	pin = kzalloc_obj(*pin, GFP_KERNEL);

[Severity: Low]
Is kzalloc_obj defined somewhere in the tree?

It does not appear to exist in the standard kernel API, which will result
in a build failure during compilation. Should this be replaced with
kzalloc(sizeof(*pin), GFP_KERNEL)?

>  	if (!pin)
>  		return ERR_PTR(-ENOMEM);
>  
>  	pin->dpll = sitdpll;
>  	pin->dir = dir;
>  	pin->id = id;
>  
>  	return pin;
>  }
[ ... ]
> @@ -1593,16 +1593,16 @@
>  struct sit9531x_dpll *sit9531x_dpll_alloc(struct sit9531x_dev *sitdev, u8 ch)
>  {
>  	struct sit9531x_dpll *sitdpll;
>  
>  	sitdpll = kzalloc_obj(*sitdpll, GFP_KERNEL);

[Severity: Low]
Similarly here, the undefined kzalloc_obj macro is used. Can this be updated
to kzalloc(sizeof(*sitdpll), GFP_KERNEL) to avoid compilation failures?

>  	if (!sitdpll)
>  		return ERR_PTR(-ENOMEM);
>  
>  	sitdpll->dev = sitdev;
>  	sitdpll->id = ch;
>  	sitdpll->lock_status = DPLL_LOCK_STATUS_UNLOCKED;
>  	sitdpll->lock_status_error = DPLL_LOCK_STATUS_ERROR_NONE;
>  	INIT_LIST_HEAD(&sitdpll->pins);
>  
>  	return sitdpll;
>  }
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013224131.27149-1-arouhi@sitime.com?part=5

  reply	other threads:[~2026-10-14 22:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 22:41 [PATCH net-next v13 00/12] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 01/12] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 02/12] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-10-14 22:41   ` sashiko-bot
2026-10-15  3:31   ` Rob Herring
2026-10-13 22:41 ` [PATCH net-next v13 03/12] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 04/12] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-10-14 22:41   ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 06/12] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 05/12] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-10-14 22:41   ` sashiko-bot [this message]
2026-10-13 22:41 ` [PATCH net-next v13 07/12] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 08/12] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-10-14 22:41   ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 09/12] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 10/12] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-10-14 22:41   ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 11/12] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 12/12] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-10-14 22:41   ` sashiko-bot

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=sashiko-outbox-171990@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arouhi@sitime.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.