From: Ali Rouhi <arouhi@sitime.com>
To: "sashiko-reviews@lists.linux.dev" <sashiko-reviews@lists.linux.dev>
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>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
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 v13 10/12] dpll: sit9531x: add support to adjust output phase
Date: Fri, 16 Oct 2026 00:55:45 +0000 [thread overview]
Message-ID: <20261016005541.11374-5-arouhi@sitime.com> (raw)
In-Reply-To: <sashiko-outbox-171998@kernel.org>
On Wed, 14 Oct 2026, sashiko-bot@kernel.org wrote:
Reply inline. Taking the three High findings together first, since
they rest on the same premise, then the two Medium.
> [Severity: High] Does this trigger an unintended phase flush on PLL 0
> when a frequency change is applied to an unrouted pin? When an output
> pin is not routed to any PLL by the boot configuration,
> sit9531x_out_state_fetch() initializes it with routed = false and
> pll_idx = 0. Since sit9531x_output_freq_set() does not check if the
> pin is routed, pll_idx = 0 is passed to
> sit9531x_output_phase_flush(), which will forcefully restart the
> dividers for all active outputs driven by PLL 0.
> [Severity: High] Does this logic fail to verify
> sitdev->out[out_idx].routed before proceeding with pll_idx = 0?
> Getter functions like sit9531x_output_phase_read() correctly check
> !sitdev->out[out_idx].routed and abort with -ENODATA, but this
> function proceeds to calculate and write register values against PLL
> 0 for unrouted pins.
> [Severity: High] Since the hardware lacks a per-output flush
> mechanism, triggering this phase flush with pll_idx = 0 for an
> unrouted output will forcefully restart the dividers for all active
> outputs legitimately driven by PLL 0. Could a user interacting with
> an unrouted, disconnected DPLL pin trigger visible edge jumps and
> hardware disruption across unrelated active outputs?
An output the loaded configuration routes to no PLL is never
registered as a pin, so neither setter can be called for one.
out[].routed is set only by sit9531x_out_state_fetch() at probe, and
sit9531x_dpll_pin_is_registrable() requires it before a pin object is
created. The pin callbacks are the only callers of
sit9531x_output_freq_set() and sit9531x_output_phase_adjust_set().
pll_idx 0 is therefore never reached on behalf of an unrouted output,
and no flush is issued on PLL A for one.
The asymmetry is real as a matter of style: the getters test routed
and the setters rely on registration instead. Adding the test to the
setters has no caller that can exercise it, so it is left for a later
series rather than added here untested.
> [Severity: Medium] When prg_commit() fails, the driver marks
> phase_stale = true but omits setting flush_pending = true (unlike the
> equivalent error path in sit9531x_output_phase_adjust_set()). Could
> this leave the output divider permanently unaligned? If the driver
> state tracking loses the pending flush requirement, a subsequent
> manual phase set request could be falsely treated as a no-op and
> dropped, preventing recovery without setting a dummy phase first.
> [Severity: Medium] Similarly to the commit failure above, if
> sit9531x_output_phase_flush() fails, the cache is marked stale but
> the pending flush requirement is not recorded. Will a subsequent
> retry with the same target phase incorrectly hit the cache path in
> sit9531x_output_phase_adjust_set() and skip the required flush?
Agreed on both, and v14 sets flush_pending on both paths, as the phase
setter already did.
On the failed flush, v14 also stores the delay that was committed
instead of marking the cache stale. A stale mark would have the
getter publish the new delay anyway, after which the core would treat
an identical retry as a request for the value the driver had just
reported, and the realignment would never run.
next prev parent reply other threads:[~2026-10-16 0:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 22:41 [PATCH net-next v13 00/12] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 01/12] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 03/12] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 02/12] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` Ali Rouhi
2026-10-15 3:31 ` Rob Herring
2026-10-16 0:55 ` Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 04/12] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 05/12] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 06/12] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 08/12] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 07/12] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 09/12] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 10/12] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` Ali Rouhi [this message]
2026-10-13 22:41 ` [PATCH net-next v13 11/12] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 12/12] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-16 0:55 ` 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=20261016005541.11374-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@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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