From: netdev-bot+sashiko@kernel.org
To: arouhi@sitime.com
Cc: jiri@resnulli.us, vadim.fedorenko@linux.dev,
arkadiusz.kubalewski@intel.com, ivecera@redhat.com,
kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, cjubran@nvidia.com,
Oleg.Zadorozhnyi@devoxsoftware.com,
prabhakar.mahadev-lad.rj@bp.renesas.com,
devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support
Date: Tue, 24 Nov 2026 00:40:36 +0000 [thread overview]
Message-ID: <179548083614.3135.11915403348553233279@kernel.org> (raw)
In-Reply-To: <20261119225752.41846-5-arouhi@sitime.com>
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] sit9531x_dev_probe() (drivers/dpll/sit9531x/core.c) never gets
or enables any supply that the series' binding defines: vdd-supply…
- [Medium] sit9531x_dev_probe() enables the XO with
devm_clk_get_optional_enabled().
- [Low] The commit message rejects a regmap paged range partly because 'a
debugfs access would move the page under the driver'.
- [Low] All three new files (core.c, core.h, regs.h) name Ali Rouhi as
Author in their headers, listed first, and MODULE_AUTHOR lists him…
--
dpll: add basic SiTime SiT9531x support
This adds the I2C probe for the SiTime SiT9531x DPLL family. It uses a
flat 256-byte regmap window, and the driver selects the page under a lock.
Probe requests the optional reset line, enables the XO, releases reset and
identifies the variant from the ID register.
> The register space is 32 pages of 256 registers, selected through offset
> 0xFF of any page. The regmap is the flat 256-byte window, and the
> accessors select the page under a lock. A regmap paged range is not
> used: it reads the selector back on each access, which doubles the bus
> traffic, and a debugfs access would move the page under the driver.
[Severity: Low]
Does the debugfs part of this rationale hold for regmap ranges?
As far as I can tell, _regmap_select_page() in drivers/base/regmap/regmap.c
selects the page again on every access through the range, under the
regmap lock:
ret = _regmap_update_bits(map, range->selector_reg,
range->selector_mask,
win_page << range->selector_shift,
NULL, false);
So a debugfs access should not leave a range-based driver with a stale
page.
The flat window chosen here looks like the design that has the
page-tracking hazard. sit9531x_page_select() trusts the cached value and
skips the selector write:
if (sitdev->page == page)
return 0;
The regmap debugfs registers file for sit9531x_regmap_config dumps offsets
0x00-0xFF of whatever page the driver last selected. It does this without
taking page_lock, and the dump does not say which page it shows.
Debugfs writes to 0xFF are compiled out by default
(REGMAP_ALLOW_WRITE_DEBUGFS is undefined), so hitting the stale cache case
needs a source change.
Could the commit message describe this tradeoff more precisely?
> Suggested-by: Ivan Vecera <ivecera@redhat.com>
> Signed-off-by: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
> Signed-off-by: Ali Rouhi <arouhi@sitime.com>
[Severity: Low]
This isn't a bug, but core.c, core.h and regs.h all name Ali Rouhi first
as Author in their headers, and MODULE_AUTHOR() lists him first too. If
he co-developed the patch, should there be a Co-developed-by: tag right
before his Signed-off-by:, as Documentation/process/submitting-patches.rst
describes?
> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> new file mode 100644
> index 0000000000000..99dd5e70dc5e6
> --- /dev/null
> +++ b/drivers/dpll/sit9531x/core.c
> @@ -0,0 +1,318 @@
[ ... ]
> +static int sit9531x_dev_probe(struct sit9531x_dev *sitdev)
> +{
> + struct clk *xtal_clk;
> + u8 variant_id;
> + int rc;
> +
> + /*
> + * Request before enabling the XO: a probe deferral would gate the XO
> + * and remove the reference of a running part.
> + */
> + sitdev->reset_gpio = devm_gpiod_get_optional(sitdev->dev, "reset",
> + GPIOD_ASIS);
> + if (IS_ERR(sitdev->reset_gpio))
> + return dev_err_probe(sitdev->dev, PTR_ERR(sitdev->reset_gpio),
> + "Failed to request reset gpio\n");
> +
> + /*
> + * Fvco = Fref * (DIVN + frac/2^32); Fref is the rate of the XO feeding
> + * XIN/XO_CLK.
> + */
> + xtal_clk = devm_clk_get_optional_enabled(sitdev->dev, "xtal");
[Severity: Medium]
The comment above says the goal is to avoid gating the XO of a running
part. Doesn't devm_clk_get_optional_enabled() still gate it on every
failure path after this point?
drivers/clk/clk-devres.c implements it as:
return __devm_clk_get(dev, id, clk_get_optional,
clk_prepare_enable, clk_disable_unprepare);
So devres calls clk_disable_unprepare() on any probe failure after this
point, while the part stays out of reset and configured. That includes:
- the "no xtal rate" -EINVAL return
- a gpiod_direction_output() failure
- a transient I2C error from sit9531x_read_variant_id()
- the "Unknown variant ID" -ENODEV return
- a devm_mutex_init() failure
The driver has no .remove and is fully devm-managed, so a sysfs unbind or
rmmod gates the XO as well.
Later patches in the series add more failure points after the XO enable
(sit9531x_devm_dpll_init(), devm_request_threaded_irq()), and the XO is
still devm-enabled.
If the XO is gateable and this driver is its only consumer, won't this
stop the reference of a chip running from its efuse/NVM configuration?
> + if (IS_ERR(xtal_clk))
> + return dev_err_probe(sitdev->dev, PTR_ERR(xtal_clk),
> + "Failed to get xtal clock\n");
[ ... ]
> + if (sitdev->reset_gpio) {
> + rc = gpiod_direction_output(sitdev->reset_gpio, 0);
> + if (rc)
> + return dev_err_probe(sitdev->dev, rc,
> + "Failed to release the reset line\n");
> + fsleep(10000); /* internal boot after release */
> + }
> +
> + rc = sit9531x_read_variant_id(sitdev, &variant_id);
[Severity: Medium]
Should probe get and enable the supplies defined in the binding before
this first I2C access?
The binding in this series (sitime,sit95316.yaml) documents vdd-supply,
vddin-supply, vdds-supply and the vddoN-supply rails. It says they are
there so that "a board with switchable rails" can describe them, and its
example points vdd-supply/vddin-supply at ®_1v8/®_3v3.
The binding commit does note "The driver does not enable them", and
sit9531x_dev_probe() makes no regulator call.
If the rail is off at probe on such a board, this read goes to an
unpowered part. Probe then fails with an I2C error or a misleading
"Unknown variant ID", and nothing points at the missing supply.
If the bootloader left the rail on, no consumer claims it. Wouldn't
regulator_late_cleanup() then turn it off? It only skips regulators that
are always_on or have a nonzero use_count. That would cut power to a
running DPLL and drop the efuse/NVM configuration this patch tries to
keep.
A separate point: when reset-gpios is absent, nothing waits before this
read, because the fsleep() only runs when the reset GPIO exists. Does the
part need time after the XO is enabled before it answers on I2C?
At the end of the series, drivers/dpll/sit9531x/ still has no regulator
handling.
> + if (rc)
> + return rc;
> +
> + sitdev->info = sit9531x_match_variant(variant_id);
> + if (!sitdev->info)
> + return dev_err_probe(sitdev->dev, -ENODEV,
> + "Unknown variant ID: 0x%02x\n",
> + variant_id);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119225752.41846-1-arouhi%40sitime.com
next prev parent reply other threads:[~2026-11-24 0:40 UTC|newest]
Thread overview: 33+ 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-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 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko [this message]
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-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-11-19 22:57 ` [PATCH net-next v16 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
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-11-19 22:57 ` [PATCH net-next v16 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 10/13] dpll: sit9531x: implement output " Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
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-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
2026-11-19 22:58 ` [PATCH net-next v16 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
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-20 22:58 ` sashiko-bot
2026-11-24 0:40 ` netdev-bot+sashiko
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
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=179548083614.3135.11915403348553233279@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--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=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