From: netdev-bot+sashiko@kernel.org
To: arouhi@sitime.com
Cc: jiri@resnulli.us, ivecera@redhat.com, vadim.fedorenko@linux.dev,
arkadiusz.kubalewski@intel.com, kuba@kernel.org,
pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com,
cjubran@nvidia.com, Oleg.Zadorozhnyi@devoxsoftware.com,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v17 12/13] dpll: sit9531x: add support to get phase offset on the connected input
Date: Thu, 03 Dec 2026 00:39:14 +0000 [thread overview]
Message-ID: <179625835436.3146.622350637250967370@kernel.org> (raw)
In-Reply-To: <20261201235202.97645-13-arouhi@sitime.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 kernel-doc for struct sit9531x_chan in
drivers/dpll/sit9531x/core.h has the two saved debug-tap fields…
- [Low] The commit message says the probe failure path "now runs the same
retries as removal", but only the DPLL-registration failure path…
--
dpll: sit9531x: add support to get phase offset on the connected input
This commit adds phase_offset_get to the sit9531x input pin ops. The
phase difference is read from the on-chip TDC through the PLL page debug
window, and the debug tap selection is saved and restored around each
sample. Tap restores that fail are retried by the poll, on removal and on
the probe failure path, which now shares sit9531x_dev_pending_retry() with
removal.
> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> index 96d317c9bf370..1f4ed3365ffe1 100644
> --- a/drivers/dpll/sit9531x/core.c
> +++ b/drivers/dpll/sit9531x/core.c
[ ... ]
> @@ -3990,6 +4172,61 @@ static void sit9531x_dev_stop(struct sit9531x_dev *sitdev)
> (sitdev->flush_armed & BIT(i)) ? "parked" : "armed");
> }
> mutex_unlock(&sitdev->multiop_lock);
> +
> + sit9531x_tap_pending_retry(sitdev);
> +}
> +
> +static int sit9531x_dev_start(struct sit9531x_dev *sitdev)
> +{
> + struct sit9531x_dpll *sitdpll;
> + int rc;
> +
> + rc = sit9531x_dev_state_fetch(sitdev);
> + if (rc)
> + return rc;
[Severity: Low]
The commit message says:
a restore that fails is retried by the poll, at removal and on the
probe failure path, which now runs the same retries as removal.
Does that hold when sit9531x_dev_state_fetch() fails? This early return
skips sit9531x_dev_pending_retry(). Only the err_unregister path below
calls it.
The state fetch can leave a PLL debug key unlocked through this call
chain:
sit9531x_dev_start()
sit9531x_dev_state_fetch()
sit9531x_chan_state_fetch()
sit9531x_chan_lock_fetch()
sit9531x_chan_routed_ref_read()
If the relock write in sit9531x_chan_routed_ref_read() still fails after
SIT9531X_CLOSE_TRIES attempts, it sets key_pending and returns the error:
relock:
lock_rc = sit9531x_write_pll_close(sitdev, pll_idx,
SIT9531X_PLL_REG_DEBUG,
SIT9531X_PLL_DEBUG_LOCK);
sitdev->chan[pll_idx].key_pending = !!lock_rc;
return rc ? rc : lock_rc;
That error ends the probe. sit9531x_devm_dpll_init() then jumps to
err_destroy_worker, and that path has no retry of its own:
rc = sit9531x_dev_start(sitdev);
if (rc) {
rc = dev_err_probe(sitdev->dev, rc, "Failed to start device\n");
goto err_destroy_worker;
}
So neither sit9531x_tap_pending_retry() nor sit9531x_debug_back_retry()
runs. The debug key is left unlocked on the part, and the "PLL%c left with
its debug taps moved or window open" warning is never printed.
The tap restore part of the claim looks fine, because tap_pending can only
be set after registration. Should this path also call
sit9531x_dev_pending_retry(), or sit9531x_tap_pending_retry() at least?
Alternatively, could the commit message be narrowed to the registration
failure path?
> +
> + mutex_lock(&sitdev->multiop_lock);
> + sit9531x_eeprom_state_report(sitdev);
> + sit9531x_pll_states_report(sitdev);
> + mutex_unlock(&sitdev->multiop_lock);
[ ... ]
> +err_unregister:
> + list_for_each_entry_continue_reverse(sitdpll, &sitdev->dplls, list)
> + sit9531x_dpll_unregister(sitdpll);
> +
> + sit9531x_dev_pending_retry(sitdev);
> +
> + return rc;
> +}
[ ... ]
> diff --git a/drivers/dpll/sit9531x/core.h b/drivers/dpll/sit9531x/core.h
> index 562c63ee117d3..933789c1aa1c5 100644
> --- a/drivers/dpll/sit9531x/core.h
> +++ b/drivers/dpll/sit9531x/core.h
> @@ -206,6 +206,9 @@ struct sit9531x_out {
> * stays in forced holdover
> * @table_back: table reported and to be rewritten while @table_pending
> * @key_pending: debug key of the PLL page not locked again
> + * @tap_pending: debug taps not restored after a phase-offset read
> + * @tap_write_code: tap selection to restore while @tap_pending
> + * @tap_read_code: readback selection to restore while @tap_pending
[Severity: Low]
This isn't a bug, but are these two descriptions swapped?
The comment this patch adds in regs.h says "Dig_Sys_ReadCode selects the
tap, Dig_Sys_WriteCode its modifiers".
The code agrees with regs.h. sit9531x_phase_offset_read() selects the TDC
tap by writing to SIT9531X_PLL_REG_DBG_READ_CODE. In
SIT9531X_PLL_REG_DBG_WRITE_CODE it only sets the low-frequency clock
modifier bit:
rc = sit9531x_write_pll_u8(sitdev, pll_idx,
SIT9531X_PLL_REG_DBG_READ_CODE,
SIT9531X_DBG_READ_CODE_TDC);
sit9531x_tap_restore() then writes tap_read_code back to READ_CODE and
tap_write_code back to WRITE_CODE:
rc = sit9531x_write_pll_close(sitdev, pll_idx,
SIT9531X_PLL_REG_DBG_READ_CODE,
chan->tap_read_code);
So tap_read_code holds the tap selection and tap_write_code holds the
modifiers.
> * @prio_srcs: cached priority table, a source code per slot
> * @prio_last: first slot of each source plus one, 0 if absent
> * @prio_mask: bit per canonical source in the priority table read back
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201235202.97645-1-arouhi%40sitime.com
next prev parent reply other threads:[~2026-12-03 0:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 23:52 [PATCH net-next v17 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-12-01 23:52 ` [PATCH net-next v17 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-12-01 23:52 ` [PATCH net-next v17 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-12-01 23:52 ` [PATCH net-next v17 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko
2026-12-01 23:52 ` [PATCH net-next v17 12/13] dpll: sit9531x: add support to get phase offset on the connected input Ali Rouhi
2026-12-03 0:39 ` netdev-bot+sashiko [this message]
2026-12-01 23:52 ` [PATCH net-next v17 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Ali Rouhi
2026-12-03 0: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=179625835436.3146.622350637250967370@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=Oleg.Zadorozhnyi@devoxsoftware.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=arouhi@sitime.com \
--cc=cjubran@nvidia.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.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