From: Ali Rouhi <arouhi@sitime.com>
To: "ivecera@redhat.com" <ivecera@redhat.com>
Cc: "jiri@resnulli.us" <jiri@resnulli.us>,
"vadim.fedorenko@linux.dev" <vadim.fedorenko@linux.dev>,
"arkadiusz.kubalewski@intel.com" <arkadiusz.kubalewski@intel.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>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v9 04/15] dpll: sit9531x: read DPLL types and pin properties from system firmware
Date: Mon, 21 Sep 2026 20:49:20 +0000 [thread overview]
Message-ID: <20260921204918.53170-2-arouhi@sitime.com> (raw)
In-Reply-To: <5757ed06-a14c-4dc5-ada8-3a76129e2d5c@redhat.com>
On 9/17/26 11:42 AM, Ivan Vecera wrote:
>> + /*
>> + * The fine step is 30 ps, but requests are accepted at 1 ps
>> + * resolution and rounded to the nearest achievable delay, so
>> + * advertise the request granularity, not the hardware step.
>> + */
>> + props->dpll_props.phase_gran = 1;
>
> What is the real HW granularity? If 30ps then you should announce 30 to
> inform the userspace that this is the step supported by the HW.
There is no single hardware step on this part, and phase-gran is not
only advisory: the core rejects any request that is not a multiple of
it, in dpll_pin_phase_adjust_set().
if (pin->prop.phase_gran && phase_adj % (s32)pin->prop.phase_gran) {
NL_SET_ERR_MSG_ATTR_FMT(extack, phase_adj_attr,
"phase adjust value not multiple of %u",
pin->prop.phase_gran);
return -EINVAL;
}
So whatever the driver announces becomes a filter on what userspace is
allowed to ask for, and that is what makes 30 the wrong number here.
A requested delay is split between two fields that are added, not
selected between: a coarse delay counted in whole VCO cycles, and a
three-bit fine field in fixed 30 ps steps. The reachable delays are
coarse * T_vco + fine * 30 ps, fine in 0..7
where T_vco is the VCO period in force. For 30 to be the right modulus,
T_vco would have to be an exact multiple of 30 ps. It is not. The
feedback divider is fractional, so Fvco is XO * (DIVN_INT + NUM/DEN)
times the doubler, and the period that falls out of that does not land
on a 30 ps boundary. As soon as one coarse cycle is part of a delay,
the reachable values are offset by that remainder and stop being
multiples of 30 at all.
Take T_vco = 240.5 ps purely as arithmetic. The reachable delays are
0, 30 ... 210, then 240.5, 270.5, and so on. Announcing 30 against that
set would be wrong in both directions at once: the core would reject
240.5, which the device produces exactly, and accept 240, which it
cannot produce at all. A faster or slower VCO does not fix this, it
only moves where the mismatch starts, and Fvco differs per PLL and per
board.
Announcing T_vco instead would at least describe the coarse field, but
it discards the fine one: the core would then refuse every delay that
is not a whole number of VCO cycles, and the 30 ps resolution inside a
cycle becomes unreachable through the ABI. It is not exact either,
since phase-gran is an integer number of picoseconds and T_vco is not.
So the driver announces 1, accepts the request, rounds it to the
nearest delay the two fields can represent, and reports back what the
registers hold rather than what was asked for. A caller that needs the
exact applied value reads it back and gets the truth for its own VCO
rate.
I recognize this leaves phase-gran carrying less information than it
does for zl3073x, where one output period is a genuine step and the
readback scales by it. If you would rather the attribute describe the
coarse field even at the cost of the fine one, I will announce T_vco
instead. I did not want to close off the resolution inside a VCO cycle
in order to make a single number look tidy.
This is unchanged in v10, with the reasoning set out in the cover
letter:
https://lore.kernel.org/netdev/20260921201108.42676-1-arouhi@sitime.com/
Thanks,
Ali
next prev parent reply other threads:[~2026-09-21 20:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 0:00 [PATCH net-next v9 00/15] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-09-15 0:00 ` [PATCH net-next v9 01/15] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-09-15 0:00 ` [PATCH net-next v9 02/15] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 03/15] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-09-17 8:42 ` Ivan Vecera
2026-09-21 20:49 ` Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 04/15] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-09-17 9:42 ` Ivan Vecera
2026-09-21 20:49 ` Ali Rouhi [this message]
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 05/15] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 06/15] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 08/15] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 07/15] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 09/15] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 10/15] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-09-17 9:55 ` Ivan Vecera
2026-09-21 20:49 ` Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 11/15] dpll: sit9531x: add support to get and set esync on pins Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 12/15] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 14/15] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 13/15] dpll: sit9531x: add support to get fractional frequency offset Ali Rouhi
2026-09-17 15:01 ` netdev-bot+sashiko
2026-09-15 0:00 ` [PATCH net-next v9 15/15] dpll: sit9531x: allow the device tree to override two board facts Ali Rouhi
2026-09-17 15:02 ` 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=20260921204918.53170-2-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®