๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17265

Re: [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test

#17265
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:30
87 lines
11284 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] The phase-adjust round-trip test test_pin_phase_adjust_set_get
  (tools/testing/selftests/drivers/dpll/dpll_features.sh) only needsโ€ฆ

--

selftests: dpll: add pin phase adjust test

This adds test_pin_phase_adjust_set_get() to dpll_features.sh. The test
reads the phase adjust range and granularity a pin reports. It sets the
largest granularity multiple inside the range, or the smallest one if the
largest is already the current value, reads it back and restores the
original value.

> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index ebb52c8526201..7b7e077073db5 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh

[ ... ]

> +	[ -n "$gran" ] || gran=1
> +	defer dpll_restore dpll_pin_set_phase_adjust "$PIN_TUNE_ID" "$before"
> +
> +	# Shell division truncates towards zero, so round the bounds towards
> +	# the inside of the range explicitly, which matters for negative ones.
> +	target=$((max / gran * gran))
> +	[ "$target" -gt "$max" ] && target=$((target - gran))
> +	if [ "$target" = "$before" ]; then
> +		target=$((min / gran * gran))
> +		[ "$target" -lt "$min" ] && target=$((target + gran))
> +	fi

[Severity: Low]
Does the round trip need the end of the advertised range here? Any value
one granularity step away from before would test the same set/get path.

On zl3073x, zl3073x_pin_props_get() reports the full s32 range for every
pin, but sets a granularity only for output pins:

drivers/dpll/zl3073x/prop.c:zl3073x_pin_props_get() {
    ...
	props->dpll_props.phase_range.min = S32_MIN;
	props->dpll_props.phase_range.max = S32_MAX;
    ...
}

So on a zl3073x input pin the test uses gran=1 and target=2147483647 ps.
zl3073x_dpll_input_pin_phase_adjust_set() then writes about 2.1 ms of
compensation into the reference's phase offset register. ice behaves the
same way with its firmware maximum, through ice_dpll_phase_range_set().

PIN_TUNE_ID comes from pin_is_spare(), which also accepts a pin in the
selectable state:

	any(.[]; .["parent-id"] == $dev and
		 (.state == "disconnected" or
		  .state == "selectable")) and
	all(.[]; .state != "connected" and .operstate != "active")

In automatic mode the DPLL can switch to that reference by itself while
the test runs, for example on failover or a revertive switch. The PTP or
SyncE outputs would then be offset by milliseconds until the deferred
restore runs.

The script header already warns against pointing it at a device whose
reference must not be disturbed, and the value is restored right away.

Would a small step such as before + gran or before - gran, clamped to
[min, max], be enough here?

> +	if [ "$target" = "$before" ] || [ "$target" -gt "$max" ] ||
> +	   [ "$target" -lt "$min" ]; then
> +		log_test_skip "DPLL pin phase-adjust set/get" "range too narrow"
> +		return
> +	fi

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112130359.840795-1-poros%40redhat.com
Technical Details
Message-ID: <179483940916.3136.8713607811565145711@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364453-linux-kernel-netdev=dewy.ru
References: <20261112130359.840795-13-poros@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364453-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test
Date: Mon, 16 Nov 2026 14:30:09 +0000
Organization: Usenet Network
Message-ID: <179483940916.3136.8713607811565145711@kernel.org>
References: <20261112130359.840795-13-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2087081"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eNbCJUIk3JJ9YPjJV7f/vvvVXqU= sha256:IIB8hz1lIGjeZMxf9T2tgNNOqABhRLjU+NR/1/2ld9Q=
	sha1:QO8F4o3xz42ILMeL7AxXhKuYoTw= sha256:mBJf5j18xBlRAybvphNGRtciLiUm+UV9tXXlMhDJ5vc=
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 B5AD9114C81; Mon, 16 Nov 2026 17:30:49 +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 KShr5qywd6DG;
	Mon, 16 Nov 2026 17:30:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-364453-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 A992E114C84; Mon, 16 Nov 2026 17:30:28 +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 76FA429981; Mon, 16 Nov 2026 14:30:22 +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=1794839412;
	b=f6n8y25grytbhVw0cvzxHCRRTSrRBzkS9xyXjGFOT7xUEhbkMe3VBqFKIPKxlyZu5XQn
	 8dww7pDTM1Vb86jwBCI86advDs0SKnwORaNI1CnMQbldS2lKyvQRM3fKXijVC25IyBD/r
	 NpdNxNNldsFook+j9pOsSMMSmHN1y8x/Nxuz7rxGwRvUNw1crz+5nXcoZlLjn+r5WWQrU
	 0oaE+sAnMuZdwqVPHkzWd2haa+Jta1/mb4w7BrV1aa7uRwycmvcP6CH2nXgRPc2V8CAjo
	 xj0yQ9FwFuPyAO4MLc90sCeNbFzBkll0i2DGU2u9W/eFpXDxCMa68J+EebHe7GmfNhA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794839412;
	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=B2QlDCVZlqCbIM0I8bDmo9isk+irTXGv5x32YCbuEHA=;
	b=dsvnJ2ffaGUEUpgzc2Ti97/nugWcbqbjdxp6xRZNx8FdG5SKrIk8f4BKwJQj3E01XLE8
	 7CF/0EchLSJ4VizLG30Li8haEU6CEbPGTpy6PwVXRvhqpfi7Q88RuBYCVXfNPXx2PLOHY
	 A8vuF9JgCSgafMBtZq8j74QVFWw/TaVK2QBr+Zk7mco9EVZxHfhGhC5q9M4k2/PLmxNyH
	 wBhVNHsfYz8dRoTCW9Si7UeQngFpvsJJhwNdT/xYvTNY4WaYInXUqSDkd/Cw1Iufh5Ue3
	 vBZhJ2uTG+zZmWWhbZCnPWJOfHtH7Nz93aNvXefgEFbyHJ6Mlzqc1WZrnzsppSzO9wQ==
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=e4reIHyH;
	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 0681760A2600;
	Mon, 16 Nov 2026 14:30:12 +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=e4reIHyH
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=1794839411;
	b=JiQhe8lAN4ITe/EVKIK7iiF8SgA+RT+hVA/HlOYfVfEYXWA5IxOtzptMAszhdpPEpYn2
	 1Q0Uvxt8X7U5rfSALk4xXyl+56+7oVhUyuZ7WJSffI6DCEYO7TL3+HJgVgB40FyJrrUvp
	 zWFphzpPUhjUxzvYlYVKlbXkZEPeGbcVtCo1YaM8Tz1dTnsGQ7ceKRAuuMlm3BFEoWGDp
	 c/R5vD3bWY43Ke8gFsoIuoopYJFxCQFLVg9q1yvjZrAOD5TW9VlI6xLuBvV++9DyVCM8f
	 P9nKI70l1Cp40QrmgmWWWotm+jVqJyE5MJhseAiepf7Ks5Hr9WDd1vJPNH36LibBIsQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794839411;
	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=B2QlDCVZlqCbIM0I8bDmo9isk+irTXGv5x32YCbuEHA=;
	b=r/21DJMQUJAWFQFNggjknTGUIlIEr+pPc3hPr9kSe8TPG6PBq/U8yf7HrbCTiLhOO5Na
	 wdLFNOecgLExmmSIXTD9eo/PUKMQBn+3YQubEFeVO385kc8aaPLaN8DlSQVplFAgM1Z3j
	 XBgA4sy2vXel6BmbHXBCRIROZ5EXf7krGydq7FARweZEvGJHAAPNPIc+U3OI0vSYn2vmV
	 vyQnyDN5/BgkqVpl4ytJcrhvQpuvsd4QyI164M+rUBsEUBrL2+Hze/7w7suKaQIbNgmKN
	 zsGyl7Y6CAxD741LyIvCaJNO94W597zDGgZUxlHpOEU9385zBNiGgmA1QiLB13mMbSg==
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=e4reIHyH;
	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 27B21606A88D;
	Mon, 16 Nov 2026 14:30:10 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C91F1F000C7;
	Mon, 16 Nov 2026 14:30:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794839410;
	bh=B2QlDCVZlqCbIM0I8bDmo9isk+irTXGv5x32YCbuEHA=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=e4reIHyHzU0g+9pBhBs5oDHsNburBjVj4hQO236cXBrJoS2ek15qoy1yN3u8yLl8e
	 GN+zgENIqaxH5KP8a/2CXu8x1BIlvgh9duumZG0T03V0FOGY7vXoe3B+X20/Z3YhXS
	 nbAkdvgjKr03I5pXKGvoPqna8/pZDS5tbFuWQd/TPtBlQrBZo0cRq98ULvY4Hckepe
	 3jMYFB6Fkw4KPpnhbzk5Sw2FuSbD/WwQrLVwJD2O1ZhJQmrHW5e/ZgMk4RE0dVSDOu
	 pTAQHWYV5lz6XiSJtZ90O4F4Df8Mq2ZYDBwD1GLnF3huiPZMHFxbPyCqPm/BClAVEv
	 ofuMurU3mQk7Q==
X-Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com,
 corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org,
 rdunlap@infradead.org, jani.nikula@intel.com, vadim.fedorenko@linux.dev,
 arkadiusz.kubalewski@intel.com, jiri@resnulli.us, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <20261112130359.840795-13-poros@redhat.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