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 v16 09/13] dpll: sit9531x: add support to get and set frequency on pins
Date: Fri, 20 Nov 2026 22:58:31 +0000 [thread overview]
Message-ID: <sashiko-outbox-226325@kernel.org> (raw)
In-Reply-To: <20261119225752.41846-10-arouhi@sitime.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dpll: sit9531x: unretried NVM update in sit9531x_prg_commit()
on error
--
commit 94b9cfbb99f072a3656d39c3238bca0469693ed3
Author: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
dpll: sit9531x: add support to get and set frequency on pins
This commit adds DPLL pin frequency get and set callbacks for the SiT9531x
driver, reporting input rates from firmware properties and reading or
programming output rates through the VCO and output divider registers.
> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> index bbc17a514c5ce..d3f6955b3bbd0 100644
> --- a/drivers/dpll/sit9531x/core.c
> +++ b/drivers/dpll/sit9531x/core.c
> @@ -460,6 +460,101 @@ static int sit9531x_output_forced_hiz(struct sit9531x_dev *sitdev,
> return 0;
> }
>
[ ... ]
> +/*
> + * Update the NVM shadow and re-lock the loops after sit9531x_prg_enter(). The
> + * sleep is the settling time after loop lock.
> + */
> +static int sit9531x_prg_commit(struct sit9531x_dev *sitdev)
> +{
> + int rc, rc2 = 0, rc3;
> + u8 attempt;
> +
> + rc = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN,
> + SIT9531X_UPDATE_NVM);
> +
> + for (attempt = 0; attempt < SIT9531X_LOOP_LOCK_TRIES; attempt++) {
> + rc2 = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN,
> + SIT9531X_LOOP_LOCK);
> + if (!rc2)
> + break;
> + usleep_range(1000, 2000);
> + }
> + if (rc2)
> + dev_err(sitdev->dev,
> + "output loops left unlocked after programming: %d\n",
> + rc2);
> +
> + sitdev->loops_open = !!rc2;
[Severity: Medium]
As reported by Jakub Kicinski on v15 [1], what happens when
sit9531x_output_divo_write() writes the new divider bytes, but the
SIT9531X_UPDATE_NVM write in sit9531x_prg_commit() fails while
SIT9531X_LOOP_LOCK succeeds?
In that case sitdev->loops_open is set to false, so the background poll
never retries sit9531x_prg_commit(), and the new DIVO register values are
neither rolled back nor committed to the NVM shadow. On the error path in
sit9531x_dpll_output_pin_frequency_set(), sit9531x_output_freq_get() then
reads back those uncommitted DIVO register bytes, updates
sitdev->out[out_idx].freq, and sends a pin change notification for a
frequency that was never committed in hardware.
[1] https://lore.kernel.org/r/20261117021818.2220307-1-kuba@kernel.org
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119225752.41846-1-arouhi@sitime.com?part=9
next prev parent reply other threads:[~2026-11-20 22:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 22:57 [PATCH net-next v16 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-19 22:57 ` [PATCH net-next v16 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-19 22:57 ` [PATCH net-next v16 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-19 22:57 ` [PATCH net-next v16 10/13] dpll: sit9531x: implement output " Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-19 22:57 ` [PATCH net-next v16 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-11-20 22:58 ` sashiko-bot [this message]
2026-11-19 22:58 ` [PATCH net-next v16 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-19 22:58 ` [PATCH net-next v16 12/13] dpll: sit9531x: add support to get phase offset on the connected input Ali Rouhi
2026-11-19 22:58 ` [PATCH net-next v16 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Ali Rouhi
2026-11-20 22:58 ` 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-226325@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.