🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21404

Re: [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support

#21404
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 00:40
201 lines
15502 bytes
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 &reg_1v8/&reg_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
Technical Details
Message-ID: <179548083614.3135.11915403348553233279@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369877-linux-kernel-netdev=dewy.ru
References: <20261119225752.41846-5-arouhi@sitime.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369877-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support
Date: Tue, 24 Nov 2026 00:40:36 +0000
Organization: Usenet Network
Message-ID: <179548083614.3135.11915403348553233279@kernel.org>
References: <20261119225752.41846-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="4017538"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xVaMlIiFOkxbWNR7hmHeykj/7as= sha256:A1RVnQ51zLvhVfBeMcyQZV0JVrd3+WXu7KeCMlVtzw4=
	sha1:hXpkRBXI8Kzhc8KURpS9j+xl48w= sha256:6oVK1+gzWPbuU6YGa3x8ETLtMbbRKc5kOivMtQIAZic=
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 F2A0E125DCB; Tue, 24 Nov 2026 03:40:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 1MC-IpZsyDz2;
	Tue, 24 Nov 2026 03:40:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369877-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 D2258125DC9; Tue, 24 Nov 2026 03:40:45 +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 7E457258D1; Tue, 24 Nov 2026 00:40:39 +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=1795480838;
	b=bR3m+vwHIwdlyM7igOkIa4WQhFaIsP3E3yrtKeIvQItYWsxlhDHD8S98uu74eqIW6AsR
	 3LnBom2MVyXgSnqmwdPgVGO5pPSFcNBWR72SZ+EN7f6oGGuUodl8DOjC9uTzVf9RVuguY
	 28x1hq0hjbmn9mIgOs+NT0hTS7NkbMeDccmU8blIX0S+9jpeqRZbpnVDAiBdgtfEP0PCB
	 U4d4og4fy4JDmljJTrve1oF7UeUfDcpOVJe5jdc77dekWWKXKooQBxhYyyOfEf19mUWzd
	 XKvB8/tJoOV+sMo5fePTUPeKAFIHRfPiBkywYTLzkm7q80OkrZ8mhQnBfv1OPBtbw8w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795480838;
	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=1mdTC7iCer+TQwL4f4nmNkxrgPoCgiJ3UcEX3hsjGJM=;
	b=MRb7iaqgM25z6BHyfqwfTm/7/396MwxKYye2ElUmG4lc3r1iQ9XejTqCrOW+7hSgmzdS
	 cGkG/3qTFga3y53SGNI4V6HdLQhOuz0yESYTOcWRkunHw5s9/6jRRgzIlpLi3wSR0RMhX
	 lOqnr3XlOMr+4KXIa7h8+NS8d1n2rXwVEiiikbl5umKCr/7CeTTwXLgapvj2529GhcEVc
	 xtWl9mmnN9S0+VOts78Z2EVbEhRuZoOzB3eXONXvgK19JEOjWjTx//GmSgZcmfNM8yM4U
	 Mr3ji2d7x0Lag/7pQCeBhLoUpzbtEayJKIq3wtFV6l1+d9U03CdcAhlyqjpTku54GEw==
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=D168XNdn;
	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 BD89B606A33E;
	Tue, 24 Nov 2026 00:40:38 +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=D168XNdn
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=1795480837;
	b=2eXBEtsJUK9a8w+kwP6qR/eW8oTFJFd4NE0y1jyKdkAgqInF84Ydy5PVgSeQqkGgqAPK
	 S9cpy1ptOo5KBlccwRfbxloHmgbI65rwcBv2EfSXpFmjAJ7+rx4MPQm1STnbAyRc31LeP
	 A+XHAb+oZThhwbo4t0d7weJzKEjQoqL8Ps6VoSCBJ9M35zwWNxY+VeuTEWUxN+84S3Kdq
	 PlnWdGQcXNL+HmGetjCS89sFNvu1e0Zma5Fw3pGHKJ6GJiZYZBIQ1hBGjbvgVqGeZ9EKg
	 jppu5O+9bc6cO/pIf56U1UF/gTxms88RCXT1Kcs9iW0siIWWiqqYJV57ievC/COo+Tg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795480837;
	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=1mdTC7iCer+TQwL4f4nmNkxrgPoCgiJ3UcEX3hsjGJM=;
	b=ngDPf6Y+wH0ycJQdMN48EMJPaSf/2eZTObAes3XDpD/GY6JrE1zLGs1AOgLyL0uEh4hl
	 1qHirt9G/taL5/LpzolVZEBpDAk20NwNqTrWY6kadfIpRUSgEka7qtHUh+p25s1zbThsv
	 XQXUAf5/VCqD59BG7V2WZu7aMCR5Vvgqji3yCD7kYLcTtB+2HMNIkLGQwjYeSXVdfkusz
	 Ei75H6B3PqK7Fyzk9namUTGJerar2j2WyOjJ82TB7fBlQG6N2HnJkky9zTUg722ixezuW
	 +fAsbDKH8NJ2CmCa1c6a73FNN1ZGnnL3rtlfDsQdMBZv9+brCgtkSK6zdNW25oP2UeA==
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=D168XNdn;
	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 DE7B1606A32E;
	Tue, 24 Nov 2026 00:40:37 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8864E1F000E0;
	Tue, 24 Nov 2026 00:40:36 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795480837;
	bh=1mdTC7iCer+TQwL4f4nmNkxrgPoCgiJ3UcEX3hsjGJM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=D168XNdnUFYwPmlq3CzrrPtL9YvOPrQ9tdaSOXPGBjSEaNz+PQOhdErK1dmEQt70s
	 PspexX1gF4tiQzxGCkYQnUUYO/nWD8upTgT+fKW/Rv2t5K8uKttQIxrazDQ3mLaU38
	 K5p/t5r3kH4k6wZhQyhJf6PyuJD97IHjwYvY6MgxtTJMkHN4GYxyxT1N6+hPXgI+rc
	 W6/LkjJaIJ9xxo0znFYZaypF1rtIJfynp2ZrVu9n8UUuDk/h0AEXLBbPYHUlYjl/1g
	 B8Fv1y6VVLaNPKchGtUuFtL6PkNPs3PZYf0tVbuFIHSO1KrAeoNSH1tj4cVyjxIz+i
	 MT8SaWKhEnAiQ==
X-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
X-In-Reply-To: <20261119225752.41846-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