Article View: linux.kernel.netdev
Article #26058Re: [PATCH net-next v17 04/13] dpll: add basic SiTime SiT9531x support
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 00:39
Date: Thu, 03 Dec 2026 00:39
226 lines
16033 bytes
16033 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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] The core rails can be switched off and on again during probe
deferral, which power-cycles the running part.
- [Low] The commit message gives an inaccurate reason for skipping
regmap's paged-range support: "A regmap paged range would read the…
- [Low] (Baseline decision: not confirmed.) The driver decides the
variant from two sources and never checks that they agree.
--
dpll: add basic SiTime SiT9531x support
This adds an I2C driver for the SiTime SiT9531x clock generator family.
Probe enables the supplies and the XO clock, releases the optional reset
line without pulsing it, waits TSTART, and reads the variant from the ID
register. Registers are accessed through a flat, uncached 256-byte regmap,
and the driver tracks the page select itself.
> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> new file mode 100644
> index 0000000000000..6b9f3609f61c5
> --- /dev/null
> +++ b/drivers/dpll/sit9531x/core.c
[ ... ]
> +/*
> + * One 256-register page is visible at a time, selected by offset 0xFF on every
> + * page. The map covers that window, uncached; the accessors select the page.
> + */
> +static const struct regmap_config sit9531x_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = SIT9531X_PAGE_SEL,
> + .cache_type = REGCACHE_NONE,
> +};
> +
> +/* Caller holds page_lock. */
> +static int sit9531x_page_select(struct sit9531x_dev *sitdev, int page)
> +{
> + int rc;
> +
> + if (sitdev->page == page)
> + return 0;
> +
> + sitdev->page = -1;
> + rc = regmap_write(sitdev->regmap, SIT9531X_PAGE_SEL, page);
[Severity: Low]
The commit message gives this reason for not using a regmap paged range:
A regmap paged range would read the selector back on each access,
doubling the bus traffic.
Is that accurate? _regmap_select_page() changes the page through
_regmap_update_bits() on range->selector_reg. For a non-volatile selector,
the old value comes from _regmap_read(), which uses the cache when there is
one. The write only happens when the value changes:
drivers/base/regmap/regmap.c:_regmap_update_bits() {
...
ret = _regmap_read(map, reg, &orig);
...
if (force_write || (tmp != orig) || map->force_write_field) {
ret = _regmap_write(map, reg, tmp);
...
}
The selector would only be read back on every access because this config
uses REGCACHE_NONE.
zl3073x in the same directory already does this. It uses a
regmap_range_cfg with REGCACHE_MAPLE, and every register except ZL_PAGE_SEL
is volatile:
drivers/dpll/zl3073x/core.c:zl3073x_is_volatile_reg() {
/* Only page selector is non-volatile */
return reg != ZL_PAGE_SEL;
}
regmap also handles a selector that sits on every page (the page_chg logic
in _regmap_select_page()), which is the 0xFF layout used here.
Could the commit message be corrected? Alternatively, could the driver use
a regmap_range_cfg with a cached selector? That would replace the
hand-written sitdev->page and page_lock tracking, and the debugfs dump
would no longer just read whatever page was selected last.
[ ... ]
> +static int sit9531x_supplies_enable(struct sit9531x_dev *sitdev)
> +{
> + unsigned int i, n = ARRAY_SIZE(sit95316_out_supplies);
> + const char * const *names = sit95316_out_supplies;
> + int rc;
> +
> + rc = devm_regulator_bulk_get_enable(sitdev->dev,
> + ARRAY_SIZE(sit9531x_core_supplies),
> + sit9531x_core_supplies);
> + if (rc)
> + return dev_err_probe(sitdev->dev, rc,
> + "Failed to enable the core supplies\n");
> +
> + if (device_is_compatible(sitdev->dev, "sitime,sit95317")) {
> + names = sit95317_out_supplies;
> + n = ARRAY_SIZE(sit95317_out_supplies);
> + }
[Severity: Low]
This isn't a bug, but the variant is taken from two places that are never
compared. The supply list here follows the DT compatible. sitdev->info
(num_outputs, clkout_map) later comes only from the ID register in
sit9531x_dev_probe():
sitdev->info = sit9531x_match_variant(variant_id);
sit9531x_of_match[] has no .data, so nothing links a compatible to an
entry in sit9531x_chip_ids[].
If the DT names the wrong part, probe succeeds without any message. The
supplies requested are those of the DT-declared part, not the detected
one.
Later in the series, output pins outside the detected clkout_map are
warned about and ignored. So what remains is that the supply set follows
the DT and no mismatch is reported.
Would it be worth adding match data per compatible and printing a
dev_warn() when it disagrees with the variant ID?
> + for (i = 0; i < n; i++) {
> + rc = devm_regulator_get_enable_optional(sitdev->dev, names[i]);
> + if (rc && rc != -ENODEV)
> + return dev_err_probe(sitdev->dev, rc,
> + "Failed to enable %s-supply\n",
> + names[i]);
> + }
> +
> + return 0;
> +}
> +
> +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");
> +
> + /* Before the XO as well, for the same reason */
> + rc = sit9531x_supplies_enable(sitdev);
> + if (rc)
> + return rc;
> +
> + /* Every rate the driver derives starts from the XO feeding XIN. */
> + xtal_clk = devm_clk_get_optional_enabled(sitdev->dev, "xtal");
> + if (IS_ERR(xtal_clk))
> + return dev_err_probe(sitdev->dev, PTR_ERR(xtal_clk),
> + "Failed to get xtal clock\n");
[Severity: Medium]
Can a probe deferral here power-cycle a running part?
By this point sit9531x_supplies_enable() has enabled vdd and vddin with
devm_regulator_bulk_get_enable(). Suppose the XO provider has not probed
yet and devm_clk_get_optional_enabled() returns -EPROBE_DEFER. The devres
unwind then runs regulator_action_disable() on the core rails.
The same thing can happen earlier, in the output rail loop of
sit9531x_supplies_enable(), which only tolerates -ENODEV:
rc = devm_regulator_get_enable_optional(sitdev->dev, names[i]);
if (rc && rc != -ENODEV)
return dev_err_probe(...);
If a vddoN or vdds supply is described in DT but its provider has not
registered yet, the call returns -EPROBE_DEFER. vdd and vddin are disabled
again on unwind.
_regulator_disable() turns the rail off when this driver is its last user
and the rail is not always-on:
drivers/regulator/core.c:_regulator_disable() {
...
if (rdev->use_count == 1 &&
(rdev->constraints && !rdev->constraints->always_on)) {
...
}
That includes rails enabled by the bootloader with regulator-boot-on,
because boot_on does not take a use_count reference.
Each deferral would then cut power to the part, and the efuse or pre-probe
NVM blob configuration that the reset handling tries to keep would be lost.
The commit message says the reset line is requested first "so a deferred
probe does not gate the clock of a running part". The regulators and the
XO don't get the same ordering, and the code at the end of the series
still has this order.
Would it work to get everything that can defer (the XO clock and all the
supplies) before enabling any of them?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201235202.97645-1-arouhi%40sitime.com
Technical Details
Message-ID:
<179625834403.3146.9112631689439856078@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376158-linux-kernel-netdev=dewy.ruReferences:
<20261201235202.97645-5-arouhi@sitime.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376158-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v17 04/13] dpll: add basic SiTime SiT9531x support Date: Thu, 03 Dec 2026 00:39:04 +0000 Organization: Usenet Network Message-ID: <179625834403.3146.9112631689439856078@kernel.org> References: <20261201235202.97645-5-arouhi@sitime.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2097404"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:sfG2luFYlUP7MdWGNGHUpgyD4WI= sha256:s0mGG9SLIIlXK17BRjPZlWbWpskiq54bDcd7r+NDDPc= sha1:KRIj9fmkpyH9iYLeUncZ3PRZ3pk= sha256:qiTEUpJ1/Xm48ZgKbzq6HNpmWOgpBucb6j7gNlusUMQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 50F2F1177BC; Thu, 3 Dec 2026 03:39:29 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wYqV3QADVu50; Thu, 3 Dec 2026 03:39:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376158-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5DDF01177B9; Thu, 3 Dec 2026 03:39:15 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 9F6B92A235; Thu, 3 Dec 2026 00:39:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796258346; b=ih6YfbUclx5zB/BX5czYEiK5R2F4sbWSMRKR4dKKfWVEfA55Ga+OX0xLSBZnxb8aY5LQ hiQatqyL3xI5pxdY26anHqFrbb97IRq9iO2Vl48PocCMsS1B3mGrSGpDyv29RmbC2LHPt jet0Q3uHpQUGCqYpkjg66c7yE0TxNCwsizW345m8BbQgNfYZ9j1WoyKs7TGOAVWbiHrFq VcjIEyB2xbMEnkS0IjDTVxaWuJ+0L4CveWXq4K38QCgZ+TukKIuF/MtiH9Irmccw5r+h1 hg3tm5sPR6SpLe3jojx/HCI/eTtohZb58Xew/P8yUUwHFBvRlmROBIyUwOux/N6RBMw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258346; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=2lWeAu9h64M+/6/VGg9iRkwXQmRrLsx+tgA/fywIDLY=; b=KyOk1zeNthTkIZomTJU9AlzlN+bWk4ttV1wjs2Jy7O9gBZxNNRxEe9wT7gUmT3K87PeI rsxdE0Wnwm9o4LgIvN2yTjT2Zw7Za2isvJvrOyWpDlGH5THz57mLa1iaws8gMZWgjveoI OrvGf/B7s2310nsGN+MwtGcrpH7hwk7kBHAD/P5wPcSaS+9cRHq3kmc29YF4IhplVzen6 elQdeDAHZyAtWeOLs07GBnvYAL+N2HeNbE0juDIIL/IBYh9JHotE6zN+LoGB5/7BGO+fT O1B10o1+lEeLdDzcAvRGk5aXm064dk0d97e8zmvubYjTESzVMntat/RvUmPw6z5G2vQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kbV5vAOb; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82F39606A337; Thu, 3 Dec 2026 00:39:06 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kbV5vAOb X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796258345; b=4qLvOoPYCUHx5DIgYLc3cDTFnXWvP4FNoLrZPQ3DWNUkLyDAOSQWwkK6a30vZ4I9+p2o xdL8YL/el75kfYc7BQO+ujbL1Ak3ThCLWodHGSUdcdhPImoOD7Cw2GsstvApuhl4ewcNU XWKDhBRZ4xK+gRbEODo38TyxF8ckPhRS0iDAe3x3K42hwENyFYG79xZYx0RSgxKnjqm3a 2hsiEz2HxTU3SkQcfAe21HElrl/Y44Vxba7UXvEBlbyBX3P4mtViXx3421BnGnDWuQcl4 UewVzeEcmmib6BsHZeGnfQyrFzmclpNvps6CKzBteQo12r5qbhZubv69+130ZBh+IhQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258345; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=2lWeAu9h64M+/6/VGg9iRkwXQmRrLsx+tgA/fywIDLY=; b=kGSJptRm3DtYPwWPjHFWZyBqUgiFt0KRVoQ7l0f/Z/1tgK2GRsonU2MFm0Kx7BcdSgOZ QMkToqqGCPHyPFcx1MpGsrygsn1zhHyAeEEYoiIxLQ5Gr1lv1KdBrTqxaM4XNFCgQqZow uTOzwdLflnQb+/hlNutMV8b6wkiig2zWl0RL48JNhMBBHFaE9eiezFw47y0ZzKwmk/gR9 rtLtfLzBP+52w51EukICkg4SJuwmcEk74qI1ijAt8YWbRkwIFx02AMF7CkiKoC3XyJRJk ExQ2/5JKCTPEmfI0Vjkvxh8aUrt6NBKu9yHfp2Fd5tAA+JdqbGQtBDl8kTrMePa3eoQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kbV5vAOb; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A114A606A335; Thu, 3 Dec 2026 00:39:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72C2D1F000C1; Thu, 3 Dec 2026 00:39:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796258345; bh=2lWeAu9h64M+/6/VGg9iRkwXQmRrLsx+tgA/fywIDLY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=kbV5vAObLNYT7Z/Z8uw153hYSKs9lY7xY8TQEUDa2UrTEGN1UtIlHdlImwSa91xEC cDoD/neYvzNzZoaiHT8lQMCfgK/EUiaTsWuFpWDBDFVqdaeQ2kti/jx8OTZzZRwwPc /FAtAVix50PjY/fzZNnXDGdIdt3Ux3VX9Wuf9hps1UttvJopyOeSquWNIbDWhUcRQG czm57rRPFVi4I8X3ogRxCVtDz1RCDQP9C2AhiGTjSe+8rFxXofBKJAG1d9YawlSzyx 8uIhaVZ/RxFNYdrqVzJrPmtXdR69sf+pEqckxD4y7fOcSB71myJzVX026Du+VMsPR1 JIYMJ6Ceg+kWQ== X-Cc: jiri@resnulli.us, ivecera@redhat.com, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, cjubran@nvidia.com, Oleg.Zadorozhnyi@devoxsoftware.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261201235202.97645-5-arouhi@sitime.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list