mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 07/13] dpll: sit9531x: implement input pin state on a DPLL
Date: Fri, 9 Oct 2026 18:23:27 +0000	[thread overview]
Message-ID: <20261009182323.76166-5-arouhi@sitime.com> (raw)
In-Reply-To: <179116260093.434549.16690142118388089479@kernel.org>

On Mon, 5 Oct 2026, netdev-bot+sashiko@kernel.org wrote:

Replies inline, in the order of the summary list. The first, second and
seventh items are one question and are answered together.

> [Severity: Medium]
> Is the active selection ever looked at again once a higher-priority input
> recovers?
>
> [...]
>
> Doesn't that leave the PLL on the lower-priority input indefinitely,
> while sit9531x_dpll_mode_get() reports DPLL_MODE_AUTOMATIC? The commit
> message says the selection goes to "the highest-priority valid input,
> which is how the DPLL interface defines automatic mode".

> [Severity: Medium]
> Can this keep a PLL on a lower-priority source while a higher-priority
> one is healthy?
>
> [...]
>
> sit9531x_dpll_mode_get() always reports DPLL_MODE_AUTOMATIC. The uAPI
> defines that as the highest priority input pin being auto selected by the
> dpll. The commit message describes this keep-in-place policy, but it also
> says the driver follows the highest-priority valid input. How do the two
> fit together?

> [Severity: Medium]
> Has the clock monitor had time to qualify a newly enabled input by the
> time the selection is picked?
>
> [...]
>
> The device only leaves its selection on LOS, and no poll path rewrites
> CLK_ACTIVESEL. Wouldn't the PLL stay on the lower-priority source after
> the new input qualifies?

That is the intended policy and the commit message now says it more
plainly. The device re-runs its own selection only when the source it
follows loses signal; it does not notice a table rewrite. Moving
CLK_ACTIVESEL on every commit was the first version of this fix. Each
move is a re-selection, which takes the PLL through holdover and unlocks
it for about ten seconds, so a priority change further down the table, or
the removal of a source the PLL is not on, must not move it. The rule
became: move only when the highest-priority live source is a different
one than before, and otherwise stay on the current source while it is
listed and has signal.

What that leaves open is the case all three items describe: the preferred
source recovers, or a newly enabled receiver qualifies after the pick
ran, and nothing re-selects. The device's own revertive switching returns
only to the source CLK_ACTIVESEL names, so the driver would have to
re-pick from the poll when the highest-priority live source differs from
the one in use. That is a re-selection, with the unlock it costs, on a
timer rather than on a request, and whether to take it under AUTOMATIC or
to document the behavior as non-revertive is still open. The commit
message states the rule as implemented and the open point; the mechanism
follows in a later revision.

> [Severity: Medium]
> Should empty come from the table the device ends up holding, not from the
> requested one?
>
> [...]
>
> The release loop then clears HO_FORCE. Wouldn't the device be left with
> an empty table, no forced holdover, and an ACTIVESEL naming the
> disconnected source?

Fixed: the decision is made on the table the device holds after the
refresh, not on the request. A failed write on a PLL whose table was
empty keeps the hold, and so does an empty request whose latch failed.

> [Severity: Medium]
> What happens if the table write and latch succeed, but all
> SIT9531X_HO_CLEAR_TRIES attempts here fail?
>
> [...]
>
> Doesn't the retry then report success while the PLL stays in forced
> holdover? The poll does not retry the release either, so the PLL seems to
> stay there until some unrelated table edit runs the full sequence again.

Fixed: the release is owed and the poll retries it every tick until it
lands, logging when it does. The request still returns the error, since
the PLL is not tracking when it returns.

> [Severity: Medium]
> Should cfg_prio[] and cfg_known be restored when
> sit9531x_prio_table_apply() fails?
>
> [...]
>
> The poll sees a changed priority and sends a notification for a
> priority that was refused.

Fixed: the configured priority and its known flag are saved before the
apply and put back when it fails, so nothing reports a priority the
device never took and the next rebuild does not use it.

> [Severity: Medium]
> Should chan->ho_valid be checked before holdover is kept forced here?
>
> [...]
>
> Doesn't that keep the device on a holdover estimate it never marked
> valid, while userspace is told it is in holdover?

The force stays: it is the only way the device follows no input at all,
and a PLL whose table is empty must not keep running on a source every
pin reports as disconnected.

What changes is the report. When the driver itself forced holdover for an
empty table and the device has not marked its holdover value valid,
lock_status_get() now reports UNLOCKED, as the uAPI text asks; HOLDOVER
is reported only when the device says the estimate is valid.

> [Severity: Medium]
> Is it safe to go ahead with the pick when sit9531x_input_mon_fetch()
> fails?
>
> [...]
>
> The comment in sit9531x_prio_activesel_pick() says such a write sends the
> PLL back to the dead source and it unlocks. Wouldn't that happen here,
> with the request reported as a success?

Fixed: a monitor read that fails rolls the commit back and returns the
error. The selection is never picked from a loss-of-signal state that may
be a poll period old.

> [Severity: Low]
> Can this early return leave HO_FORCE asserted?
>
> [...]
>
> Should this path also try to clear the bit before returning?

> [Severity: Low]
> Is the old value of HO_FORCE meant to be thrown away?
>
> [...]
>
> Say the loaded profile or an external tool left a PLL in forced
> holdover. Any SELECTABLE or DISCONNECTED change on that PLL, or a later
> priority set, would then quietly release it and let it lock to a
> reference.

Fixed, in two parts. A force that failed to write is released all the
same, because the write may have landed: the failure goes to the release
path rather than returning. And a hold the driver did not set -- one
found set with a non-empty table and no release owed, so placed by the
loaded configuration or by a tool -- is left in place by a table write;
only the hold the driver set for an empty table is released. The force is
written as the register was read with the bit set, so the
read-modify-write the finding points at is gone.

> [Severity: Low]
> Now that operstate_on_dpll_get is added, does anything send a
> dpll_pin_change_ntf() when the operstate changes?
>
> [...]
>
> The gap seems to exist only at this commit.

That is the state of this patch; the next one, which adds priority,
extends the comparison to operational state and priority, and that is
where the series ends up. Moving the comparison into this patch would
compare an attribute the patch does not yet report.

> [Severity: Low]
> What happens to seen_srcs when the commit and this read-back both fail?
>
> [...]
>
> Doesn't that overwrite priorities set through sit9531x_input_prio_set()
> with slot positions from a table nobody asked for? The reseed check
> cannot tell a failed write by the driver apart from an outside rewrite.

Right: two consecutive bus failures make the next poll adopt whatever
table the device holds, and the configured priorities become the slot
positions of that table. Adopting the device's table is the designed
recovery for an outside rewrite, and the driver cannot tell the two apart
from the table alone. Remembering that its own commit failed, so that the
next poll refreshes seen_srcs without re-seeding the configured
priorities, is a small flag and is noted for a later revision. The
priorities the poll reports in the meantime are the ones actually in the
device.

> [Severity: Low]
> Does the rollback skip the register whose write failed?
>
> [...]
>
> Later in the series, sit9531x_output_divo_write() restores "the byte
> whose write reported the error" (j <= written). Should this sequence do
> the same?

Fixed: the register whose write failed is restored too, from the byte
read before the write, which is what the output divider's rollback
already did.

  reply	other threads:[~2026-10-09 18:23 UTC|newest]

Thread overview: 40+ 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 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 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 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 [this message]
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
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-09 18:23     ` Ali Rouhi
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-5-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

all inboxes | Powered by JetHome®