๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21409

Re: [PATCH net-next v16 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware

#21409
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 00:40
146 lines
12914 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] At this commit nothing writes ref[].sig_mode, so it stays
  SIT9531X_MODE_SE from devm_kzalloc().
- [Low] When an output has no supported-frequencies-hz,
  sit9531x_pin_props_get() advertises a hard-coded continuous range,โ€ฆ

--

dpll: sit9531x: read DPLL types and pin properties from system firmware

This adds prop.c. It reads the DPLL type from the firmware node, plus
each pin's label, connection type and supported frequencies, and uses
defaults when the node doesn't provide them. An output with no
supported-frequencies-hz is advertised as one continuous frequency
range.

> diff --git a/drivers/dpll/sit9531x/core.h b/drivers/dpll/sit9531x/core.h
> index 0f826313eff8c..7a81c9b14b7fd 100644
> --- a/drivers/dpll/sit9531x/core.h
> +++ b/drivers/dpll/sit9531x/core.h

[ ... ]

> @@ -41,6 +49,35 @@ struct sit9531x_chip_info {
>  	const u8	*clkout_map;
>  };
>  

[ ... ]

> +/*
> + * struct sit9531x_ref - input reference state
> + * @freq: configured frequency in Hz
> + * @sig_mode: signal mode of the input pair, read from CLKINx_INPUT_MODE at
> + *   probe
> + */
> +struct sit9531x_ref {
> +	u64		freq;
> +	enum sit9531x_signal_mode	sig_mode;
> +};

[Severity: Low]
This isn't a bug, but is this kernel-doc accurate at this point in the
series?

Nothing in this commit writes ref[].sig_mode, so it stays at
SIT9531X_MODE_SE from the zeroed allocation. That means the differential
branch in sit9531x_input_pin_label() can't run yet:

    if (sitdev->ref[id].sig_mode == SIT9531X_MODE_DE)
        snprintf(props->package_label,
                 sizeof(props->package_label), "IN%u", pair);

The binding's pin numbering text ("A pair the loaded configuration runs
differential is one input, described at 2k") also has no effect until
then.

A later patch in the series fixes this. In "dpll: sit9531x: register
DPLL devices and pins", sit9531x_input_mode_fetch() reads
CLKINx_INPUT_MODE for every pair at probe and sets both lanes:

    sitdev->ref[pair * 2].sig_mode = sig_mode;
    sitdev->ref[pair * 2 + 1].sig_mode = sig_mode;

So the per-lane ref[id] lookup here gets the right value. Also, nothing
calls sit9531x_pin_props_get() at this commit, so no wrong label can be
registered in the meantime.

Would it be clearer to add this kernel-doc text in the same patch as
sit9531x_input_mode_fetch()?

> diff --git a/drivers/dpll/sit9531x/prop.c b/drivers/dpll/sit9531x/prop.c
> new file mode 100644
> index 0000000000000..b9405eba49a39
> --- /dev/null
> +++ b/drivers/dpll/sit9531x/prop.c
> @@ -0,0 +1,327 @@

[ ... ]

> +skip_fwnode_props:
> +	if (sync_in || sync_out)
> +		return props;
> +
> +	/*
> +	 * An output with no listed rates gets one wide range, as the setter
> +	 * checks Fvco/N; the XO gets its one rate.
> +	 */
> +	ranges = kcalloc(num_freqs + 1, sizeof(*ranges), GFP_KERNEL);

[ ... ]

> +	if (!num_freqs && dir == DPLL_PIN_DIRECTION_OUTPUT) {
> +		ranges[j].min = 1;
> +		ranges[j].max = 1000000000ULL; /* 1 GHz */
> +		j++;

[Severity: Low]
Where does the 1 GHz upper bound in sit9531x_pin_props_get() come from?
It isn't derived from the part's limits, and it doesn't match the
setter added later in the series.

In "dpll: sit9531x: add support to get and set frequency on pins",
sit9531x_output_freq_set() accepts any exact Fvco/N up to U32_MAX:

    if (frequency > U32_MAX)
        return -EINVAL;
    ...
    if (divo > SIT9531X_DIVO_MAX)
        return -EINVAL;

Fvco is at least 4.9152 GHz, so dividers from 2 to 7 give about 1.1 to
3.9 GHz across the VCO bands. However, dpll_pin_freq_set() in
drivers/dpll/dpll_netlink.c checks the advertised ranges before it calls
the driver:

    if (!dpll_pin_is_freq_supported(pin, freq)) {
        NL_SET_ERR_MSG_ATTR(extack, a, "frequency is not supported by the device");
        return -EINVAL;
    }

On a board with no supported-frequencies-hz in DT, can a DPLL_CMD_PIN_SET
above 1 GHz ever reach sit9531x_output_freq_set()? It looks like the
core would always return -EINVAL for those divider values. The uAPI
would then report a ceiling that doesn't come from the hardware. I
couldn't confirm from the tree whether the output buffers can actually
drive more than 1 GHz.

The 1 Hz lower bound is fine. SIT9531X_DIVO_MAX is GENMASK_ULL(33, 0),
so 1 Hz is an exact Fvco/N.

Also, the comment says "as the setter checks Fvco/N", but that setter
only arrives in the later commit mentioned above.

Could the upper bound come from the VCO and divider limits, or from a
documented output maximum, so the advertised range and the setter
agree?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119225752.41846-1-arouhi%40sitime.com
Technical Details
Message-ID: <179548083991.3135.257746872384905150@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369879-linux-kernel-netdev=dewy.ru
References: <20261119225752.41846-6-arouhi@sitime.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369879-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v16 05/13] dpll: sit9531x: read DPLL types and
 pin properties from system firmware
Date: Tue, 24 Nov 2026 00:40:39 +0000
Organization: Usenet Network
Message-ID: <179548083991.3135.257746872384905150@kernel.org>
References: <20261119225752.41846-6-arouhi@sitime.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4017836"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:AC6ERwX2Gm7eDQQbhem5/fDYTVU= sha256:QjNioiET9RFBEfYQPw/CcGbJSpp7cDctU7qINpchsIk=
	sha1:YqRg9M7zQsCkXdZEuvqKMqRpqS8= sha256:czbke5BcnaLUdmCdcuuFCV2I+3Z2K1w0gaSx7zUxrcQ=
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 051B1125DCC; Tue, 24 Nov 2026 03:41: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 x4A_mo2lX9qu;
	Tue, 24 Nov 2026 03:41: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-369879-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 280CE125DC7; Tue, 24 Nov 2026 03:41:17 +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 EE99827C9A; Tue, 24 Nov 2026 00:40:54 +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=1795480842;
	b=kCQWqTwHjPM2EqyeNPkTMZ8eoIIrbYBk0UGpYcPTSw/VKA101dC8BUHsv2JEFGkiAW/G
	 KL/zHX/2OUJwVrBBHQU8kXShbJGnaRDddt4Pxg2riqcuMz7ybaXFUoEKqvG5lsCAhB8FR
	 mlVWP6GpL9nCXuix8QhnkhWcakJjt1TU2Uib+sbeXvj0A7ed+IOQPQuzWTIMOPnm4xwyq
	 HxE/UqUMISwufh4p4X4Q3Vj4WlC4fpMmy0SiA7nfc3lLwN1T4jasX9W16PtyHhYQSfnk/
	 WZ8dQ+Nk6DXXAytT1KtW82lp8HSN189MBOHFzPLf2f+8M6T7l9wPl4qJ087uJSIPhJw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795480842;
	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=WczDa/DdtekPr78ZQiSSWKxGrLszSJ6wbNBUvaiGJIE=;
	b=i9BdILb242IyEnHXG1sS0hB9TKPbxDPxJ9+f+bZWf9fr6OMWj6Jjuh6uzIn1+OGc/nPJ
	 solj9W0cfTpM/6+LlkUvAc/94Ad/UDcq+e6CvPt6nRZUmMlig/KnP5jJ/9dbcYHbSJXAT
	 q32SSsegpRy1KYNj8xJ2fYmK1DHo9FCyFO4VwmG2BsaCy20P27pesMb+7IxN7s72pQioJ
	 y6QsLOKy9tla41YM02lbYXAmeSdg85TRD/KnkbQ2tzWsoGdYEWm60wSs3Qec2O6j1HyOA
	 rOCk2+mH/8BBNfJmcQYFUbJJv7jV9STSXNSM2FGh5TqGZu4hG30CYIIoaG+StfbJ6ZQ==
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="oNIF6j/L";
	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 8B341606A6A5;
	Tue, 24 Nov 2026 00:40:42 +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=oNIF6j/L
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=1795480841;
	b=tPFNhv7JkZYCxV3II3j7idMSjXftalJ88f3grLXEUWwDUWGGLaiPze9JesOfN8oq5jiY
	 bbk+uu8baYWHLLFuegZaCJAvjJxuHqlYvIyxJmOzNBqXhS7vYooir/CvhvCxc38NLduCj
	 QPAkExJ/62BnNWBRHh7qJRJuOvUQIWNPR5FAgcU5tmWTwD7KUSxjrWOer0dFr/NsBzy1l
	 swXH/qCR6IKCMA58ecTERrTJBmXosNRlqk059d0sR/TOtMF03OOcuOfzlmJtuaiy2Snxu
	 Yu8ijdbOB4Gh0fVCaeW0aBoOIHBAngOmJ0sxENlYk1kQ+2d/sXecjAHzd5vDuukJ+ZQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795480841;
	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=WczDa/DdtekPr78ZQiSSWKxGrLszSJ6wbNBUvaiGJIE=;
	b=rRDQ2h4yjE0xzPWIerSJu4lFYSiOG4xvXrhDmK3ds3L6HFcXQB0T0L08EKP3AT077N8M
	 Zuh38ORTIxA1x3xKw1biWa0B/gN2W1XeMmE7UU4bo245Q+evYku2oOTuVa5Gu2UClhSCL
	 6mLoI5KOk+ewXJL7VYeh70lNa+AnvxLMewInIClUmhhmvf73OeypDd72NG0hZrMnaRpdX
	 vtJ6ODX1htFm5pufKPhMToX368p8WWDETC5vaXcvQg7UFXOcm++epD3jJ4CA23sBOMvwR
	 Ue/t/UyI8TwZahTkh8F0CUh8Kxd5nYYPnc8Kb5UukqvR+fb5S3X5qGAeMAA7UlOArOQ==
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="oNIF6j/L";
	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 ACA2B606A331;
	Tue, 24 Nov 2026 00:40:41 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 616B11F00A19;
	Tue, 24 Nov 2026 00:40:40 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795480841;
	bh=WczDa/DdtekPr78ZQiSSWKxGrLszSJ6wbNBUvaiGJIE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=oNIF6j/Lee/Zcnwk7Sjl9pCHorv2aOJqMT+aUhYBs2TsKEX1Aw57nSyDUYC4l/bLh
	 ReKbufuA7HuXVw3ldkX9n+TwqTm31y8uuK4mqkWVQlcTzZnRKNRenVIpP2RCVLih2w
	 A1Zh3o/J+grtwySfk079x6Whqs5lJMjCpsgPGJwWkVaxAsaC7hk4hxAR/O5JMtKIkG
	 sfu7davvAqFbXdP3ezHF7thm6izLNE+Xt+bmsVlcCNhJ0jj9fhavgbjPdQIeqKQI5d
	 5UtVRaqf+GduTFeezFKBRUZRwcxiXAUzep+oe0YN03ppOkk02Ab9qsQ1QSrGF50DaW
	 tERv3KmBI6G9Q==
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-6-arouhi@sitime.com>
X-sashiko-severity: Low
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