Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
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
Subject: Re: [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test
Date: Mon, 16 Nov 2026 14:30:09 +0000	[thread overview]
Message-ID: <179483940916.3136.8713607811565145711@kernel.org> (raw)
In-Reply-To: <20261112130359.840795-13-poros@redhat.com>

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

  reply	other threads:[~2026-11-16 14:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 13:03 [PATCH net-next v4 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 01/14] dpll: dpllsim: Add " Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-11-16 14:29   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 06/14] selftests: dpll: add pin state tests Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 08/14] selftests: dpll: add pin priority test Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko [this message]
2026-11-12 13:03 ` [PATCH net-next v4 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-11-16 14:30   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179483940916.3136.8713607811565145711@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jani.nikula@intel.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox