🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17576

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

#17576
From: Jakub Kicinski
Date: Tue, 17 Nov 2026 02:18
106 lines
11606 bytes
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
dpll: sit9531x: read DPLL types and pin properties from system firmware

This commit adds prop.c. It reads the DPLL type from "dpll-types". From the
input-pins and output-pins firmware sub-nodes it reads each pin's label,
connection type and supported frequencies. It also builds package labels
for the inputs, the outputs, the XO and the INTSYNC pins, and gives outputs
with no supported-frequencies-hz a 1 Hz to 1 GHz range.

> Read the DPLL type and, for each pin, its label, direction, capabilities
> and supported frequencies from the firmware node, with defaults for a
> node that gives none.

[Severity: Low]
Does this description match what sit9531x_pin_props_get() does?

The direction is not read from the firmware node. It is the dir argument
passed in by the caller. It only selects which sub-node ("input-pins" or
"output-pins") sit9531x_prop_pin_fwnode_get() searches.

The capabilities are not read from firmware either. Each pin class gets a
fixed value: DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE, or 0 for the XO.

The message also leaves out two things the code does:

- It parses the per-pin connection-type property into DPLL_PIN_TYPE_*.

- The getter writes sitdev->ref[index].freq, using the first
  supported-frequencies-hz entry.

Could the commit message be updated to match the code?

> 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 @@

[ ... ]

> +	if (!fwnode_property_present(props->fwnode,
> +				     "supported-frequencies-hz"))
> +		goto skip_fwnode_props;
> +
> +	/* A -hz property is 32-bit; no rate of this part needs more. */
> +	num_freqs = fwnode_property_count_u32(props->fwnode,
> +					      "supported-frequencies-hz");

[ ... ]

> +	rc = fwnode_property_read_u32_array(props->fwnode,
> +					    "supported-frequencies-hz",
> +					    freqs, num_freqs);
> +	if (rc) {
> +		dev_warn(sitdev->dev,
> +			 "failed to parse supported-frequencies-hz for %s: %d\n",
> +			 props->package_label, rc);
> +		goto err_alloc_ranges;
> +	}
> +
> +	/* The first listed rate seeds the input's rate */
> +	if (num_freqs > 0 && dir == DPLL_PIN_DIRECTION_INPUT && !xo)
> +		curr_freq = freqs[0];

[Severity: Medium]
This reads supported-frequencies-hz as u32. Does that match the other
driver that uses this generic property?

The property is defined in the shared dpll-pin.yaml, which does not give a
cell width. zl3073x_pin_props_get() reads the same property as u64:

drivers/dpll/zl3073x/prop.c:zl3073x_pin_props_get() {
    ...
	num_freqs = fwnode_property_count_u64(props->fwnode,
					      "supported-frequencies-hz");
    ...
	fwnode_property_read_u64_array(props->fwnode,
				       "supported-frequencies-hz", freqs,
				       num_freqs);
    ...
}

The microchip,zl30731.yaml examples also use /bits/ 64 for it.

Suppose a SiT9531x board DT follows that convention:

    supported-frequencies-hz = /bits/ 64 <10000000>;

That is one item, so it passes the sitime binding's maxItems: 1. But
fwnode_property_count_u32() returns 2, and freqs[] becomes {0, 10000000}.

curr_freq = freqs[0] is then 0, so sitdev->ref[index].freq never gets
set. The pin also advertises a DPLL_PIN_FREQUENCY(0) entry next to the
real rate.

The reverse also breaks: zl3073x would read a 32-bit cell list as packed
u64 values.

Should the shared binding define one width that both drivers follow, or
should the sitime binding state the 32-bit width explicitly?

[ ... ]
Technical Details
Message-ID: <20261117021811.2220116-1-kuba@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364901-linux-kernel-netdev=dewy.ru
References: <20261110202607.55744-6-arouhi@sitime.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364901-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v15 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware
Date: Mon, 16 Nov 2026 18:18:11 -0800
Organization: Usenet Network
Message-ID: <20261117021811.2220116-1-kuba@kernel.org>
References: <20261110202607.55744-6-arouhi@sitime.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2219437"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KwbgRN0yz9h4RkNloBO15CylhQE= sha256:vjU5VBZq7rRvyf8gEf3vFE7+ZMssCbP08JG+Yck87JI=
	sha1:xJL+CoOdSe3ijPjrmqy6B2MTK6M= sha256:W0/LHovp9wdQKE71qwk5HStta6pcvp9PxWVgCKX5vZw=
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 B50EC114E18; Tue, 17 Nov 2026 05:18:33 +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 nUgF5blnOKMC;
	Tue, 17 Nov 2026 05:18:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-364901-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id B1E5B114E02; Tue, 17 Nov 2026 05:18:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id B7DCE27020; Tue, 17 Nov 2026 02:18:16 +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=1794881895;
	b=nIgBnG4Ly9fK5V+1025pm4kmE4D9EBfeGSj4VBQ8STlJVt2Za/XcWZbgzRTTlT/UjQVA
	 kiZcj3CkZd1/3nY7ogBtPKL6BGDvD5Ca+o5A/jTJwOS0ZtFgAZ0t5UZ1EDPrwiN5LU+pB
	 YvAaEPZaWu17qphVOAWucQIbpEKbBzzYA1myI69zG50KWYPvKErJmn28efPG4jqugDlAq
	 vH13EdBUQKK1fTGwK0QUAh0UoSdZMVQzzQpZJLT1fMhUwAK5srBYuLpVgjmU3ejqAzNzD
	 acF2aapoOXvXnSHFuqoi/M2x+fk7Icpwix8WZVA2dM4o1kH2ADPmR76S82GpkcDe7Ig==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794881895;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=NcnjKRzqIty6DSvUi988wG09npHOupeuFWZpOtOlzJo=;
	b=AkpduStDiUF5KOWP9KWdvtzxdnATV4sSmsUbaEs94apFB7Iuv8j9E5t2rUWYIr4NuB2P
	 PcG3FHc2fhOql6GogltndZ9pEoAkKaZ4JUrNe/unZTH1ZdoELmTvuEBIKMolTLySAzlLH
	 8M77s7putShAtf0jKejTNjpmm6BxjQ3bn8nqMhgVvZI7j2kiz4/5UmyNduk5XMQcUonv0
	 U8I6KacXJWbJ6Cs/593FyimzAMjaNkiEiWWzcLDGry33M1mCTau0gf1jVTmDHukq8ZSVY
	 SiZf1cqWAbjoW1zExkU/AHhFGsestaUt8PN4KdUuhqvQ6zkfj4kpxrUARx4IJyosJlw==
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=V6CTV3wS;
	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 78A37606A883;
	Tue, 17 Nov 2026 02:18:15 +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=V6CTV3wS
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=1794881894;
	b=FnGvLKnB+W2kXYrAAnv/XrZdg03F0TinV9gVOBAku+7BTMPDZQd/jE56vb1W5mH/oYnZ
	 Xjihdv+WxAq79+OiRFoUGJ32J5+Cp0qx7P0pPZCD9tj3Qw/ON8TzjGLRYJiwFzNBpr7mC
	 nha9erFlxtTVh1ogV4iG41wPVRH8/qStKJ/XgryGGS2z9a/pqY87mjfTyMr+5NbVsrtqs
	 onSNxdfH19aRfHuN3FyA3YlYCmWGuVYD9ZFtd9uZLf6QlcyshSKaKoKuCz9eeNbuF+vfW
	 +9R/Ck6mj1QRsIPTvtN+gQ9i6f/xPL6M0RemIZ0TxiL+a4PI1ovis3wAT2dKdssJI/Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794881894;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Transfer-Encoding;
	bh=NcnjKRzqIty6DSvUi988wG09npHOupeuFWZpOtOlzJo=;
	b=p7p8stlsf/WEnP10MIo43Cw/dvPsCTWHLwOE8/OThLP2HCqoGnreUyUCAMLqSWZmB6zH
	 muhnBSbep9vXUYnP6cwTjmYks8ql/Gkn6mDZQnIGrpkGPPBiuHf0P4a7Gy3nh1spg3gib
	 BqtAOLeFvLMX21Hdl12mQ0hstLMa7ik9zC7gWHjfy9atFYGexb/mXyn9XgGuU3EYboPF5
	 aD0aGYzXdw4W0MvBgg2V+Ira5Ybb3wPrM+W3pH/kfikn+wzuZ+ndHmPQM4FSaZBVeCyXJ
	 0ETc2/sfrIC4EfiUTM6LgJ/2FA+pso2/uIqggEBGnaBY2u9WGmEh0X6wSfb1u2kTMjg==
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=V6CTV3wS;
	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 97F4F606A88D;
	Tue, 17 Nov 2026 02:18:14 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 670EA1F000C9;
	Tue, 17 Nov 2026 02:18:13 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794881894;
	bh=NcnjKRzqIty6DSvUi988wG09npHOupeuFWZpOtOlzJo=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=V6CTV3wS09f0lFxHDCayEnBSSkaeazxm3wk6QWIgezC3/I0uf1vCriCMo5tFW8BrB
	 pdsJMfT0rdBDmYT/gqOyqYULJFyrti7FiOXzWhRiep/QOeBD7LoBGngkfmYUEg6XL8
	 1kX7L4J986t0fzmK3UglhsYxhMLtVCBYO13qR7Sqkeei/FH0Vb4XujigaVAy5AmQJP
	 qdTdVvepUpkbOF1IXb8ktbdzsXxei3WSxniUa9zjL7rlo1Jw/2djFwOizGwUJ1nRM0
	 xxJkk107VQ+PQDLp+IXfd/HwtdjoSTAkgr1LC0dLSSGExOlIS86BrBuq0Ujo6GPnO+
	 OmNvKCtIqnY3g==
X-Cc: Jakub Kicinski <kuba@kernel.org>,
	jiri@resnulli.us,
	vadim.fedorenko@linux.dev,
	arkadiusz.kubalewski@intel.com,
	ivecera@redhat.com,
	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-Mailer: git-send-email 2.56.1
X-In-Reply-To: <20261110202607.55744-6-arouhi@sitime.com>
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