From: Ali Rouhi <arouhi@sitime.com>
To: Jakub Kicinski <kuba@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>,
"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 v15 10/13] dpll: sit9531x: implement output pin state on a DPLL
Date: Thu, 19 Nov 2026 21:20:19 +0000 [thread overview]
Message-ID: <20261119212014.13180-7-arouhi@sitime.com> (raw)
In-Reply-To: <20261117021821.2220343-1-kuba@kernel.org>
On Mon, 16 Nov 2026 18:18:21 -0800, Jakub Kicinski wrote:
> > + rc = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN,
> > + SIT9531X_PRG_CMD_STATE);
> > + if (rc) {
> > + sit9531x_prg_commit(sitdev);
> > + return rc;
> > + }
>
> [Severity: Medium]
> If the SIT9531X_PRG_CMD_STATE write fails, should this path really run the
> full sit9531x_prg_commit()?
>
> Before this patch, the failure path called sit9531x_prg_abort(). Its comment
> was "Close the loops and lock the debug block without committing".
> sit9531x_prg_commit() starts by writing to the same register that just
> failed:
>
> rc = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN,
> SIT9531X_UPDATE_NVM);
>
> After that it retries LOOP_LOCK, rewrites sitdev->loops_open, sleeps 100 ms
> under multiop_lock and closes the debug key. Its return value is ignored
> here.
>
> So an entry that may never have reached PRG_CMD now sends an NVM shadow
> update. The comment above sit9531x_prg_commit() ("re-lock the loops after
> sit9531x_prg_enter()") does not seem to describe this case.
>
> This also changes how the existing caller sit9531x_output_freq_set() from
> the previous patch behaves on failure. The new sit9531x_output_enable() and
> sit9531x_output_disable() paths get the same behaviour. The commit message
> does not mention the change.
>
> Was this meant to be part of this patch, or should a commit-free abort stay
> on this path? The same call is still there at the end of the series.
Agreed, and already changed: a failed entry now only re-locks the loops
and closes the key, without the bank update. The bank update is written
once, by a frequency change whose divider was written.
> > + false);
> > + if (rc)
> > + return rc;
> > + }
> > + return 0;
> > + }
>
> [Severity: Medium]
> Does un-mute lose a Hi-Z force set by the loaded profile?
>
> This branch clears the MASK bit of all three pairs and restores nothing. The
> mute path saves mask[] and state[], but uses them only to roll back on
> error.
>
> The commit message says "an un-mute releases the force and the pads return
> to the loaded configuration". Take a CMOS output whose profile forces one
> pad and leaves the other driving (part_muted). Here the force on that pad
> is cleared too.
>
> sit9531x_dpll_output_pin_state_on_dpll_get() reports such an output as
> CONNECTED, which matches the core.h kernel-doc ("reported as driven").
> However, sit9531x_dpll_output_pin_state_on_dpll_set() skips a request only
> when part_muted is clear:
>
> if (!sit9531x_output_state_refresh(sitdev, dpin->id) &&
> sitdev->out[dpin->id].enabled == enable &&
> !sitdev->out[dpin->id].part_muted) {
>
> dpll_pin_state_set() in the DPLL core does not compare against the current
> state. So a request for CONNECTED, which GET already reports, still reaches
> sit9531x_output_enable(). That runs the 100 ms programming sequence and
> releases the pad the profile kept in Hi-Z. A mute followed by an un-mute
> ends the same way.
>
> Should the un-mute put back the profile's original force bits instead of
> always clearing them? This code is unchanged at the end of the series.
Agreed. The next revision records, at probe, the pad the loaded
configuration forces on an output it leaves driving, and an un-mute
releases only what the driver forced, so both sequences above end with
the pads as the configuration set them.
> > + if (rc)
> > + return rc;
> > +
> > + rc = sit9531x_output_hiz_write(sitdev, slot, true);
> > +
> > + ret = sit9531x_prg_commit(sitdev);
>
> [Severity: Low]
> This isn't a bug, but every mute and un-mute runs the full output-system
> programming sequence. That is debug unlock, PRG_CMD, UPDATE_NVM, LOOP_LOCK
> and a 100 ms sleep under multiop_lock.
>
> The commit message says this happens "inside the programming state". The
> previous patch describes the settling time of that state, and the comment
> in sit9531x_dpll_output_pin_state_on_dpll_set() documents the 100 ms
> loop-unlock window. So this is mostly covered already.
>
> Would it still be worth stating the cost explicitly in this commit message?
That cost is gone in the next revision: the force bits act when written,
so a mute or un-mute writes them under the debug key and nothing else.
> > + int rc = 0;
> > +
> > + mutex_lock(&sitdev->multiop_lock);
> > + out = sit9531x_out_state_get(sitdev, dpin->id);
> > + if (out->state_stale)
> > + rc = sit9531x_output_state_refresh(sitdev, dpin->id);
>
> [Severity: Low]
> Can this report an old mute state if the Hi-Z force bits are changed outside
> the driver?
>
> The hardware is read again here only when state_stale is set. The poll
> re-reads an output in sit9531x_dpll_output_ntf_pending() only when the
> driver itself has set ntf_pending:
>
> if (!out->ntf_pending)
> return false;
>
> Suppose a profile is reloaded, or the registers are written with an I2C
> tool, while the driver is bound. GET then keeps returning the old
> CONNECTED/DISCONNECTED value, and no pin change notification is sent.
>
> The input priority tables are handled differently: the poll picks up
> external rewrites. The output frequency and phase getters read the
> registers live. Later in the series the cache is refreshed on resume, but
> runtime polling still never refreshes it.
>
> Is that difference intended?
Intended. The poll reads what the part changes by itself, and the
priority table because the re-selection depends on it. The force bits
change only when something writes them, and a write under a bound driver
is the I2C_SLAVE_FORCE override; polling twelve outputs would add about
fifty transfers to every tick for that case. Resume re-reads them since
a power loss reloads them.
next prev parent reply other threads:[~2026-11-19 21:20 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 20:26 [PATCH net-next v15 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-11-11 15:35 ` Ivan Vecera
2026-11-10 20:26 ` [PATCH net-next v15 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi [this message]
2026-11-10 20:26 ` [PATCH net-next v15 12/13] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Ali Rouhi
2026-11-17 2:18 ` Jakub Kicinski
2026-11-19 21:20 ` Ali Rouhi
2026-11-17 9:27 ` [PATCH net-next v15 00/13] dpll: add SiTime SiT9531x DPLL clock driver Paolo Abeni
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=20261119212014.13180-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@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
all inboxes | Powered by JetHome®