mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ali Rouhi <arouhi@sitime.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Ali Rouhi <arouhi@sitime.com>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"vadim.fedorenko@linux.dev" <vadim.fedorenko@linux.dev>,
	"arkadiusz.kubalewski@intel.com" <arkadiusz.kubalewski@intel.com>,
	"ivecera@redhat.com" <ivecera@redhat.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"cjubran@nvidia.com" <cjubran@nvidia.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"Oleg.Zadorozhnyi@devoxsoftware.com"
	<Oleg.Zadorozhnyi@devoxsoftware.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v8 08/15] dpll: sit9531x: add support to get and set frequency on pins
Date: Mon, 14 Sep 2026 23:00:37 +0000	[thread overview]
Message-ID: <20260914230034.63861-7-arouhi@sitime.com> (raw)
In-Reply-To: <178887151864.219967.4978978194985471898@kernel.org>

Replies inline.

> Does a single pin set also carry two side effects the message does not
> mention? [NVM shadow write, sibling phase restart, ~100 ms]

The v9 changelog now states that a per-pin frequency set runs
inside the chip's programming state: it updates the NVM shadow, re-locks the
loops with the required settle time, and restarts the output dividers of the
owning PLL phase-aligned.  That is the device's programming model for divider
changes, not something the driver can decompose.

> This comment describes "the previous split between free-run and sync
> formulas" [...] Could the paragraph be dropped [...]?

Dropped in v9 -- the sit9531x_get_fvco() kernel-doc now describes what
the function does, without referring to out-of-tree history.

> Is SIT9531X_PLL_PHFL_ON_DEMAND_EN meant to stay set after the flush?

No -- fixed in v9: the on-demand enable is disarmed after the one-shot
flush, together with the trigger-source restore, so a later assertion of the
restored trigger cannot re-flush the PLL's outputs.

> Is it safe to program a real divider from a guessed VCO rate here? [...]
> Would returning an error when the VCO cannot be read be preferable, and
> should sit9531x_get_fvco() distinguish a bus error from a dormant PLL?

v9 makes sit9531x_get_fvco()
propagate a register-read failure as an error distinct from "DIVN not
programmed", and the frequency setter fails the request instead of programming
a divider from a band-edge guess.

> Can a request that the driver advertised as supported be satisfied at a
> materially different rate here?

The advertised set was the real problem and is fixed
in v9: pins now advertise the concrete firmware-listed rates (plus the current
one), so the normal path validates against rates the divider chain actually
produces.  The wide range remains only on outputs whose DT lists nothing; for
those the divider can only produce Fvco/N and v9 reports the effective rate
back through frequency_get, which is the value the core then exposes.  We
prefer reporting the achievable truth over rejecting, since a board that
declares its rates never hits the rounding path.

> What happens to the 34-bit divider when one of these five writes fails
> partway through?

Fixed in v9: the five previous bytes are read and saved before the
write, and a mid-sequence failure restores them before the commit, so a mixed
old/new divider is never latched.

> Is a u32 wide enough for the effective rate this line caches?

The reachable overflow is closed in v9: the setter rejects any request
above U32_MAX (see below), so no accepted request can cache a wrapping rate.

> The Return: block lists 0, -ENODEV and register access errors, but this
> -EINVAL [...] is not among them. [and step numbering]

Both fixed in v9 -- the Return: block lists -EINVAL and the step
numbering in the doc block and the body agree.

> The changelog says "An input's frequency is what the board presents".  Is
> ref->freq actually that value when a board lists several rates?

The device cannot measure an input's rate, so the board's declaration
is the only source there is.  When a board lists several rates the first entry
is taken as the nominal one presently wired -- that is a board-authoring
convention we will spell out in the binding description.  Boards for which
this matters can list the live rate first or list only one rate.

> does this read past ref[] for the INTSYNC pin at this point in the series?

Resolved by the v9 registration restructure: the
INTSYNC pins are not registered until their dedicated ops tables exist, so no
intermediate commit exposes ref[9]/out[12] through the frequency callbacks.

> does this also swallow I2C and regmap errors? [freq_get fallback]

v9 falls back to the cached value
only for -ENODEV (the genuinely unresolvable routing case the comment
describes) and propagates register access errors, so a transient bus failure
is not reported as a live frequency and cannot spoof the set path's
old == new short-circuit.

> Should this setter sanity-check the upper bound of frequency itself?

Yes -- fixed in v9: the setter rejects any request above U32_MAX,
closing the "4294967297 Hz validates as 1 Hz" hole, and independently rejects
a DIVO that does not fit its 34-bit field.

  reply	other threads:[~2026-09-14 23:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 21:40 [PATCH net-next v8 00/15] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 01/15] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 03/15] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 02/15] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 05/15] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 04/15] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 07/15] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 06/15] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 08/15] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi [this message]
2026-09-02 21:40 ` [PATCH net-next v8 09/15] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 10/15] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 11/15] dpll: sit9531x: add support to get and set esync on pins Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 12/15] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 13/15] dpll: sit9531x: add support to get fractional frequency offset Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 15/15] dpll: sit9531x: allow the device tree to override two board facts Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-02 21:40 ` [PATCH net-next v8 14/15] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-09-08 12:45   ` netdev-bot+sashiko
2026-09-14 23:00     ` Ali Rouhi
2026-09-08 12:57 ` [PATCH net-next v8 00/15] dpll: add SiTime SiT9531x DPLL clock driver Paolo Abeni
2026-09-14 23:00   ` Ali Rouhi

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=20260914230034.63861-7-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=linux-kernel@vger.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

all inboxes | Powered by JetHome®