From: Ali Rouhi <arouhi@sitime.com>
To: "netdev-bot+sashiko@kernel.org" <netdev-bot+sashiko@kernel.org>
Cc: "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>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@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>,
"Oleg.Zadorozhnyi@devoxsoftware.com"
<Oleg.Zadorozhnyi@devoxsoftware.com>,
"prabhakar.mahadev-lad.rj@bp.renesas.com"
<prabhakar.mahadev-lad.rj@bp.renesas.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 v16 08/13] dpll: sit9531x: add support to get and set priority on input pins
Date: Tue, 1 Dec 2026 23:51:41 +0000 [thread overview]
Message-ID: <20261201235136.95422-7-arouhi@sitime.com> (raw)
In-Reply-To: <179548084402.3135.10043442329542996745@kernel.org>
On Tue, 24 Nov 2026 00:40:44 +0000, netdev-bot+sashiko@kernel.org wrote:
> > + */
> > rc = sit9531x_input_mon_fetch(sitdev);
> > if (rc)
> > goto rollback;
> > + if (!chan->stale && chan->routed_ref != SIT9531X_REF_INVALID)
> > + routed = sit9531x_input_hw_src(chan->routed_ref);
>
> [Severity: Medium]
> Is chan->routed_ref recent enough to latch here? It is only set in
> sit9531x_chan_state_fetch(), once per poll or after an earlier commit, and
> the comment above says it is the last poll's sample. Before the pick,
> sit9531x_input_mon_fetch() refreshes only the LOS monitors.
>
> Take this sequence within one poll period:
>
> poll: chan->routed_ref = B
> B has a brief LOS, the device falls back to C (and does not revert)
> B recovers before the next poll
> prio_set or state_set on an unrelated input
> sit9531x_prio_table_commit()
> sit9531x_prio_top_live() is unchanged
> sit9531x_prio_activesel_pick() returns routed (B): live and listed
>
> Would the commit then write B into CLK_ACTIVESEL and move the PLL off C,
> the reference it is actually tracking? That looks like the acquisition
> restart the commit message says this change avoids:
>
> "A commit that leaves the best live source unchanged keeps the routed
> source as the active selection, so the PLL does not restart
> acquisition for it."
>
> Could the routed source be sampled with sit9531x_chan_routed_ref_read()
> before HO_FORCE is written, and that value latched instead?
> sit9531x_chan_state_fetch() only reads it while the PLL is tracking and not
> frozen, so the cached copy can't be refreshed through that path here.
No. In v17 sit9531x_prio_table_commit() reads the routed source from the
status bus before the holdover write, while the PLL tracks a reference,
and the pick uses that value.
> > + chan = &sitdev->chan[pll_idx];
> > + old_prio = chan->cfg_prio[input_idx];
> > + old_known = chan->cfg_known;
> > + chan->cfg_prio[input_idx] = prio;
> > + chan->cfg_known |= BIT(input_idx);
>
> [Severity: Medium]
> How does a user priority compare with the OCXO's place in the table?
>
> sit9531x_prio_cfg_seed() sets the OCXO's configured priority from its slot
> index in the profile table:
>
> drivers/dpll/sit9531x/core.c:sit9531x_prio_cfg_seed() {
> ...
> chan->cfg_prio[src] = slot;
> chan->cfg_known |= BIT(src);
> ...
> }
>
> That value is in 0..10, but this function accepts 0..255 for the other
> inputs. sit9531x_prio_table_build() then sorts every member by cfg_prio,
> the OCXO included:
>
> sit9531x_dpll_input_pin_prio_set()
> sit9531x_input_prio_set()
> sit9531x_prio_table_apply()
> sit9531x_prio_table_build()
>
> Suppose a profile, or an external table rewrite that the poll accepts as
> configuration, lists the OCXO at slot k. Any input given a priority above k
> (20, 50 or 100, all normal-looking DPLL priorities) is then sorted behind
> the OCXO.
>
> sit9531x_prio_src_live() always treats the OCXO as live:
>
> if (index >= sitdev->info->num_inputs)
> return true;
>
> The device also falls back down the table without reverting. Can that
> input ever be selected while the OCXO is listed?
>
> Userspace also has no way to see or change the OCXO's priority, or to drop
> it from the table:
>
> static const struct dpll_pin_ops sit9531x_dpll_xo_pin_ops = {
> .direction_get = sit9531x_dpll_input_pin_direction_get,
> .state_on_dpll_get = sit9531x_dpll_xo_pin_state_on_dpll_get,
> };
>
> The xo branch in sit9531x_pin_props_get() also leaves capabilities at 0.
> On this point the commit message only says "The range is 0 to 255 over
> eleven slots".
>
> Should the OCXO's priority be exposed, or should user priorities be mapped
> relative to its position?
In v17 the XO pin of an automatic PLL reports the OCXO's slot as its
priority, on the same scale as the inputs, so user space sees where the
OCXO sorts. The XO pin has no priority setter: its place belongs to the
loaded configuration.
> > props->dpll_props.type = DPLL_PIN_TYPE_EXT;
> > props->dpll_props.capabilities =
> > + DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE |
> > DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE;
> > curr_freq = sitdev->ref[index].freq;
> > } else {
>
> [Severity: Low]
> Is PRIORITY_CAN_CHANGE accurate when every PLL uses manual input select?
>
> For a manual PLL, sit9531x_dpll_pin_ops_get() returns
> sit9531x_dpll_input_pin_manual_ops, which has neither prio_get nor
> prio_set:
>
> if (sit9531x_chan_state_get(sitdev, pin->dpll->id)->manual_input)
> return &sit9531x_dpll_input_pin_manual_ops;
>
> All four PLLs share one dpll_pin per index, and capabilities are per pin.
> So with mixed modes the bit has to be advertised, and the DPLL core's
> per-ref ops checks handle the manual PLLs.
>
> The driver reads manual_input at probe, before any pin is registered, so
> it knows when all four PLLs are manual. In that case the reference pins
> and the INTSYNC destination pin still advertise PRIORITY_CAN_CHANGE. They
> report no priority, and every set fails in dpll_pin_prio_set() with a bare
> -EOPNOTSUPP and no extack message.
>
> Could the bit be left off when no PLL can take a priority?
No. In v17 the input pins and the INTSYNC destination advertise neither
a priority nor a state change while every PLL is on manual input select.
next prev parent reply other threads:[~2026-12-01 23:52 UTC|newest]
Thread overview: 38+ 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 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` 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 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
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-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
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-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi [this message]
2026-11-19 22:57 ` [PATCH net-next v16 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
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-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
2026-11-19 22:58 ` [PATCH net-next v16 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` Ali Rouhi
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-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` 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-24 0:40 ` netdev-bot+sashiko
2026-12-01 23:51 ` 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=20261201235136.95422-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=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=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