From: Ali Rouhi <arouhi@sitime.com>
To: "netdev-bot+sashiko@kernel.org" <netdev-bot+sashiko@kernel.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Ivan Vecera <ivecera@redhat.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Carolina Jubran <cjubran@nvidia.com>,
Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v11 11/13] dpll: sit9531x: add support to adjust output phase
Date: Fri, 9 Oct 2026 18:23:29 +0000 [thread overview]
Message-ID: <20261009182323.76166-9-arouhi@sitime.com> (raw)
In-Reply-To: <179116260667.434549.14297756482397841280@kernel.org>
On Mon, 5 Oct 2026, netdev-bot+sashiko@kernel.org wrote:
Replies inline, in the order of the summary list. Nine of the ten are
fixed; the third is answered and its documentation fixed.
> [Severity: Medium]
> How many times does one rate change disturb the PLL here?
> sit9531x_output_freq_set() has already called sit9531x_output_phase_flush()
> after the DIVO commit.
>
> [...]
>
> Should the commit message mention the full PLL restart? And could the rate
> change avoid the second programming cycle and flush?
Fixed: a rate change on an output with a programmed delay re-times the
delay inside the rate change's own programming window, so there is one
sequence and one flush instead of two of each.
The commit message now also says what the flush is on a PLL the loaded
profile builds without the phase-flush feature: realigning its outputs
restarts the whole PLL, so a phase adjust or a rate change on such a PLL
is a loss of lock as well as an edge jump on its other outputs.
> [Severity: Medium]
> Can this seed a clamped value that a later rate change then writes to the
> device?
>
> [...]
>
> The getter also reports +1 ms while the hardware holds 10 ms. A request
> for exactly +1 ms is therefore dropped by dpll_pin_phase_adj_set() and
> never reaches the device.
Fixed: a delay the loaded configuration left beyond the advertised window
is reported clamped and is not armed, so a later rate change does not
write the clamp into the device. The setter arms only a request that
quantized to something. Both comments are corrected.
> [Severity: Medium]
> Is this the inverse of the encoding in
> sit9531x_output_phase_adjust_set()? After the fold, ps < t_out_ps. When
> t_out_ps <= SIT9531X_OUT_PHASE_ADJ_MAX_PS, which is every output faster
> than 1 kHz, the two conditions can never both hold, so the function never
> returns a negative value.
>
> [...]
>
> The kernel-doc above says such an advance "reads back as that advance".
> That does not seem to hold for these outputs.
The register is unsigned, so a delay D and an advance of T - D are the
same edge, and the sign the driver reports for it is a convention. The
reader reports the advance form only where the delay form lies beyond the
advertised window, which for an output faster than 1 kHz never happens;
so a -30000 ps request on 10 MHz reads back as +70000 ps. Both describe
the same edge, and a later rate change re-times the same edge either way.
What was wrong is the kernel-doc, which promised the advance form
unconditionally. It now says when it applies, and the commit message says
the same.
> [Severity: Medium]
> Does this drop register access errors from sit9531x_output_divo_read()?
> An I2C or regmap error is handled the same way as -ENODATA, and the
> function falls through to:
>
> [...]
>
> Should only -ENODATA skip the fold, with other errors returned?
Fixed: a bus error from the divider read fails the read-back; only the
"no divider programmed" case skips the fold.
> [Severity: Medium]
> Is a failed flush here ever retried? The delay bytes can be committed and
> then sit9531x_output_phase_flush() can fail, for example on its first
> CONFIG47 read. When that happens, phase_stale is the only record of the
> failure.
>
> [...]
>
> Either way the realignment never happens, although phase_stale exists to
> force a rewrite after this kind of failure. Should a pending flush be
> tracked separately from an unconfirmed cache?
Fixed: a flush that failed after the delay was committed is remembered in
its own flag, which the getter leaves alone and the setter honors by
flushing even when the requested bytes match the cache. The cache keeps
the value the output actually realizes.
> [Severity: Medium]
> Does truncating the period to whole picoseconds give the wrong fold for
> requests longer than one period? The dropped fraction accumulates once for
> every period that is folded away.
>
> [...]
>
> The read-back fold in sit9531x_output_phase_read() uses the same truncated
> period.
Fixed: the fold is counted in VCO cycles modulo the divider, which is
exactly the period, and the sub-cycle picoseconds are carried across.
1e8 ps on a 128 MHz output of a 5.12 GHz VCO folds to zero, as it should,
and the read-back folds the same way.
> [Severity: Medium]
> Is this block reached on every path where the divider changed? Earlier in
> sit9531x_output_freq_set(), the function returns before getting here:
>
> [...]
>
> Should the error path set phase_stale when phase_armed is set?
Fixed: when the commit fails after the divider was written, an armed
delay is marked stale so the next read goes to the device rather than to
a cache that describes the old period.
> [Severity: Medium]
> Can this conversion overflow and raise a divide error? Here coarse is a
> raw 34-bit value from the device. sit9531x_get_fvco() only rejects
> fvco == 0; an out-of-band fvco gets a dev_warn_once() and is returned
> anyway.
>
> [...]
>
> sit9531x_divn_static() already guards against this kind of #DE. Should
> these conversions also bound fvco or the result?
Fixed through the VCO floor described on 09/13: a rate below the low band
is reported as no data before any conversion runs, so neither the phase
code nor the time-to-digital converter path can divide by it.
> [Severity: Low]
> Is "well beyond the DCO dynamic range" accurate? The PRG_RST_DELAY coarse
> field is 34 bits of VCO cycles, about 3.4 s at 5 GHz, and requests are
> folded modulo one output period. On a 1 PPS output, the hardware can
> therefore realize delays anywhere in the 1 s period.
>
> [...]
>
> On slow outputs, the +/-1 ms window is narrower than what the hardware can
> do. The real limit is the s32 picosecond uAPI (about +/-2.147 ms), not the
> device.
Fixed: the device holds a delay anywhere within the output period, so on
a slow output the bound is the signed 32-bit picosecond attribute rather
than the hardware. The comment in prop.c and the commit message say that
instead.
> [Severity: Low]
> Is the previous coarse cycle ever considered here? The fine field goes up
> to 7 * 30 = 210 ps, which is longer than one VCO period in every
> supported band. So coarse - 1 with a large fine code can be closer, or
> even exact.
>
> [...]
>
> The quantizer is also not idempotent for such encodings. A profile holding
> coarse 0 / fine 7 seeds phase_adj = 210 and phase_armed = true. The next
> frequency_set re-encodes it as 200 ps, which rewrites the registers and
> flushes the PLL.
Fixed: the candidates are one cycle fewer, the floor and one cycle more,
each with the fine steps capped, and the nearest wins; 210 ps at 5 GHz
encodes as seven fine steps exactly rather than one cycle short. The
comment that said the fine field tops out below one VCO period was wrong
too -- 210 ps exceeds every in-band cycle -- and is gone.
next prev parent reply other threads:[~2026-10-09 18:23 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 23:37 [PATCH net-next v11 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 01/13] dt-bindings: dpll: allow hex unit addresses on output pins Ali Rouhi
2026-10-02 8:32 ` Krzysztof Kozlowski
2026-09-30 23:37 ` [PATCH net-next v11 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-10-05 1:09 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-10-06 3:22 ` Rob Herring (Arm)
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-10-05 1:09 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-10-05 1:09 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-10-05 1:09 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 12/13] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi
2026-09-30 23:37 ` [PATCH net-next v11 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-09 18:23 ` Ali Rouhi [this message]
2026-09-30 23:37 ` [PATCH net-next v11 13/13] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-10-05 1:10 ` netdev-bot+sashiko
2026-10-07 2:10 ` [PATCH net-next v11 00/13] dpll: add SiTime SiT9531x DPLL clock driver patchwork-bot+netdevbpf
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=20261009182323.76166-9-arouhi@sitime.com \
--to=arouhi@sitime.com \
--cc=Oleg.Zadorozhnyi@devoxsoftware.com \
--cc=arkadiusz.kubalewski@intel.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-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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