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 v5 08/14] selftests: dpll: add pin priority test
Date: Sun, 29 Nov 2026 10:38:52 +0000	[thread overview]
Message-ID: <179594873230.3146.1439194847668718778@kernel.org> (raw)
In-Reply-To: <20261125090522.3777494-9-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] In `tools/testing/selftests/drivers/dpll/dpll_features.sh`,
  `test_pin_priority_get_set()` never checks that the starting priority…
- [Low] `test_pin_priority_get_set()` in
  `tools/testing/selftests/drivers/dpll/dpll_features.sh` reads the pin…

--

selftests: dpll: add pin priority test

This adds a test to dpll_features.sh that sets a new priority on a spare
input pin, reads it back and restores the original value. The
dpllsim_add_pin() helper gains an optional priority argument. The
standard and stress devices now configure priorities for their input
pins.

> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index 61ebfd9e71892..34e6b28ee224c 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh

[ ... ]

> @@ -130,6 +131,138 @@ pin_tune_spare()
>  	return 1
>  }
>  
> +test_pin_priority_get_set()
> +{

[ ... ]

> +	pin_tune_spare "DPLL pin priority set/get" || return
> +
> +	# A query that failed is not a pin without a priority.
> +	if ! before=$(dpll_pin_get_prio "$DPLL_DEV_ID" "$PIN_TUNE_ID"); then
> +		check_err 1 "pin $PIN_TUNE_ID query failed"
> +		log_test "DPLL pin priority set/get"
> +		return
> +	fi
> +	if [ -z "$before" ]; then
> +		dpll_log_test_skip_or_fail "DPLL pin priority set/get" \
> +		    "prio not reported"
> +		return
> +	fi

[Severity: Low]
On the device the script creates, should before also be compared with
the priority this patch configures?

This patch makes dpllsim_add_standard_pins() write prio 0 to gnss0 and
prio 1 to ext0. The dpllsim_setup_standard_device() comment documents
that layout, and Documentation/driver-api/dpllsim.rst says "Every live
transition starts from the configured values".

Here, though, the only check on before is that it is not empty. The
readback of target and the restore check that follow are both relative
to before.

Suppose dpllsim_pin_prio_store() stopped storing cfg_prio, or
dpllsim_pin_reset() in drivers/dpll/dpllsim/dpll.c stopped doing this:

	pin->prio = pin->cfg_prio;

ext0 would then report the simulator default (DPLLSIM_DEFAULT_PIN_PRIO,
128) instead of 1, and this test would still pass.

No other selftest under tools/testing/selftests/drivers/dpll/ compares
the reported prio with the layout either. As a result, nothing tests the
initial priority on its way from configfs to netlink.

[ ... ]

> +	# The selection may have taken the pin since pin_tune_spare
> +	# looked, as in the state test, and a priority that ranks lower
> +	# could make the device leave it for another input.
> +	case "$state" in
> +	disconnected|selectable)
> +		;;
> +	*)
> +		dpll_log_test_skip_or_fail "DPLL pin priority set/get" \
> +		    "the input pin is not spare any more"
> +		return
> +		;;
> +	esac

[Severity: Low]
Can this re-check see the case it describes on zl3073x in automatic
mode?

In AUTO mode, zl3073x reports SELECTABLE for every input whose priority
is not NONE, including the reference the channel is locked to. It never
reports CONNECTED in that mode:

drivers/dpll/zl3073x/dpll.c:zl3073x_dpll_input_pin_state_on_dpll_get() {
    ...
	case ZL_DPLL_MODE_REFSEL_MODE_AUTO:
		if (zl3073x_chan_ref_is_selectable(chan, ref))
			*state = DPLL_PIN_STATE_SELECTABLE;
		else
			*state = DPLL_PIN_STATE_DISCONNECTED;
		break;
    ...
}

The only place the live reference shows up is operstate. That is set to
DPLL_PIN_OPERSTATE_ACTIVE in zl3073x_dpll_ref_operstate_get().
pin_is_spare() checks operstate, but this re-check reads .state only.

Several netlink calls run between pin_tune_spare() and this point: the
prio query, the write-back of before, and the mode and state queries.
Suppose the channel switches to PIN_TUNE_ID in that window. The check
still passes, and the loop writes before + 1 or before + 2 to the live
reference.

Could that make the device switch to another qualified input until the
restore runs?

The state test's copy of this check limits it to ice in its comment
("ice reports it connected then"). This comment reads as if it applied
to any driver.

Would calling pin_tune_spare() again here, or also reading operstate,
close the gap on zl3073x?

> +	candidates=("$((before + 1))" "$((before + 2))")
> +	if [ "$mode" != automatic ] || [ "$state" = disconnected ]; then
> +		candidates+=("$((before - 1))" 1 7)
> +	fi

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com

  parent reply	other threads:[~2026-11-29 10:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  9:05 [PATCH net-next v5 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 01/14] dpll: dpllsim: Add " Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 06/14] selftests: dpll: add pin state tests Petr Oros
2026-11-27 13:39   ` Ivan Vecera
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-11-27 13:39   ` Ivan Vecera
2026-11-25  9:05 ` [PATCH net-next v5 08/14] selftests: dpll: add pin priority test Petr Oros
2026-11-27 13:40   ` Ivan Vecera
2026-11-29 10:38   ` netdev-bot+sashiko [this message]
2026-11-25  9:05 ` [PATCH net-next v5 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-11-27 13:40   ` Ivan Vecera
2026-11-25  9:05 ` [PATCH net-next v5 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-11-25  9:05 ` [PATCH net-next v5 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-11-29 10:38   ` netdev-bot+sashiko
2026-11-25  9:05 ` [PATCH net-next v5 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-11-29 10:39   ` 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=179594873230.3146.1439194847668718778@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