๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Mon, 16 Nov 2026 14:30
Re: [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test
#17265
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads