mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: Ali Rouhi <arouhi@sitime.com>, Jiri Pirko <jiri@resnulli.us>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.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 v12 06/12] dpll: sit9531x: implement input pin state on a DPLL
Date: Tue, 13 Oct 2026 11:37:45 +0200	[thread overview]
Message-ID: <37e2a938-9ab1-4fa3-b67d-6286ae8cc2ec@redhat.com> (raw)
In-Reply-To: <20261009183151.78497-7-arouhi@sitime.com>

On 10/9/26 20:31, Ali Rouhi wrote:
> From: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
> 
> Report and set whether an input takes part in a PLL's reference
> selection.  The device selects its reference itself from a priority
> table, so membership of that table is what the state means here: an input
> in the table is selectable, one absent from it is disconnected.  Setting
> the state adds the input to the table or removes it, and membership is
> read back from the device rather than remembered.  CONNECTED would ask
> for this input and no other, which the device cannot be told to do, so it
> is refused.  A physical input's receiver is shared by the four PLLs and is
> powered down only when the last of them lets go of it.
> 
> What the device does with an input is its operational state.  The pin
> reported active is the one the device says it feeds the PLL, read from
> the PLL's debug status bus, while the PLL is locked to it -- outer loop
> running, not frozen -- and its lane has signal.  It is not the active
> selection: that names the source the driver asked for, and when that
> source loses its signal the device falls back to another listed source
> on its own and leaves the selection naming the dead one, so after such a
> failover the pin the PLL moved to reports active and the one it left
> does not.  The status bus names what is fed to the PLL, not what the PLL
> is locked to, so the lane's monitor has to agree.  It is read only while
> the PLL tracks a reference, six transfers per such PLL per tick; in
> free-run the PLL is fed nothing.  The poll reads every lane's clock
> monitor: an input whose monitor reports loss of signal is no-signal, one
> that reports a frequency drift is qual-failed, any other is standby.
> 
> The table is built from a priority the driver keeps per source and PLL,
> seeded from the table the device loaded: members in priority order, the
> slots past the last one naming no source.  The four-bit slot encoding
> has two codes for a fifth input pair this part does not have, and one of
> them serves as that.  A disconnected input keeps its priority for when it
> comes back, and a table that would come out as the device already holds
> it is not written.
> 
> The last register of the table also carries the device's active
> selection.  After a table write the PLL goes to the source it names, and
> leaves it on its own only when that source loses its signal, so every
> write names a source the PLL can use.  When the priorities put a
> different source with signal first, the selection goes to it -- the
> highest-priority valid input, which is how the DPLL interface defines
> automatic mode.  A write that only changes the table below that source
> leaves the selection where it is while it is still listed and has
> signal, so an edit there does not pull a PLL off a healthy reference;
> failing that, it goes to the first listed source that has signal.
> 
> Removing the last input is allowed.  The selection then has nothing to
> name, and left as it is it would keep the PLL following its old source
> for as long as that has signal, so the PLL stays in the forced holdover
> the write sequence uses -- the one state in which it follows no input.
> The next write that lists a source releases it.  A holdover the driver
> did not force -- set by the loaded configuration or by a tool -- is left
> in place by such a write; only the hold the driver itself set for an
> empty table is released.
> 
> The pins fall into three roles and only the first answers this question,
> so the contract for all of them is written above the operations rather
> than left to be inferred: inputs and the inter-PLL sync destination take
> part in selection; an output and the sync source are driven by the PLL and
> report whether they carry a signal; the crystal is fixed and always
> connected, since a PLL cannot be told to stop using it.
> 
> Probe also warns about a firmware pin node whose reg names no pin the
> device can have -- a lane or an output the variant lacks, or the N lane
> of a pair the configuration runs differential -- since nodes are looked
> up from the pins and such a node would otherwise be dropped silently.
> 
> Rewriting the table means forcing the PLL into holdover, waiting for it to
> take, writing every slot and releasing holdover again, all under the
> device lock -- ten to twenty milliseconds.  The device has no way to
> change one slot in isolation, and holdover is what keeps the loop from
> chasing a table that is momentarily inconsistent, so the sequence is the
> cost of doing it correctly.  Its error paths leave the device where the
> request found it: a failed write is rolled back through the register
> that failed, a force that failed is released all the same since the
> write may have landed, the hold stays when the table the device holds
> afterwards lists no source, and the selection is never picked from a
> monitor read that failed.  A release that fails after the table was
> written and latched is owed, and the poll retries it until it lands.
> A hold with no source listed and no valid holdover memory reports the
> PLL unlocked, as the interface asks, rather than in holdover.
> 
> Signed-off-by: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
> Assisted-by: LLM
> Signed-off-by: Ali Rouhi <arouhi@sitime.com>
> ---
>   drivers/dpll/sit9531x/core.c | 1145 ++++++++++++++++++++++++++++++++--
>   drivers/dpll/sit9531x/core.h |   42 +-
>   drivers/dpll/sit9531x/dpll.c |  320 +++++++++-
>   drivers/dpll/sit9531x/regs.h |   41 ++
>   4 files changed, 1483 insertions(+), 65 deletions(-)
> 
Reviewed-by: Ivan Vecera <ivecera@redhat.com>


  reply	other threads:[~2026-10-13  9:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 18:31 [PATCH net-next v12 00/12] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-10-09 18:31 ` [PATCH net-next v12 02/12] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-10-09 18:31 ` [PATCH net-next v12 01/12] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-10-09 18:31 ` [PATCH net-next v12 03/12] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-10-13  9:11   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 04/12] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-10-13  9:14   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 05/12] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-10-13  9:35   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 06/12] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-10-13  9:37   ` Ivan Vecera [this message]
2026-10-09 18:31 ` [PATCH net-next v12 08/12] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-10-13  9:43   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 07/12] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-10-13  9:43   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 09/12] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-10-13  9:46   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 10/12] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-10-13 10:02   ` Ivan Vecera
2026-10-09 18:31 ` [PATCH net-next v12 11/12] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-10-13 10:10   ` Ivan Vecera
2026-10-09 18:32 ` [PATCH net-next v12 12/12] dpll: sit9531x: model the inter-PLL sync net as a pair of pins 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=37e2a938-9ab1-4fa3-b67d-6286ae8cc2ec@redhat.com \
    --to=ivecera@redhat.com \
    --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=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=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®