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 08/14] selftests: dpll: add pin priority test
Date: Mon, 16 Nov 2026 14:30:03 +0000 [thread overview]
Message-ID: <179483940380.3136.1462332477683774177@kernel.org> (raw)
In-Reply-To: <20261112130359.840795-9-poros@redhat.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In test_pin_priority_get_set
(tools/testing/selftests/drivers/dpll/dpll_features.sh), the candidate…
- [Low] test_pin_priority_get_set (dpll_features.sh, line 93) ignores the
exit status of dpll_pin_get_prio: `before=$(dpll_pin_get_prio…
- [Low] Part of the commit message rationale is out of date after v4.
--
selftests: dpll: add pin priority test
This adds test_pin_priority_get_set() to dpll_features.sh. The test writes
the current priority of a spare input pin back, sets a new priority from a
list of candidates, reads it back and restores the original. The
dpllsim_add_pin helper gains an optional priority argument, and the
standard and stress simulator devices now set priorities on their input
pins.
> The range of priorities a device accepts is
> not advertised over netlink, so the test tries one below the current
> value and then the small values every driver accepts, since a large
> current value may mark an unused pin outside the settable range, as the
> ice driver does with 255. A driver may still refuse all of them for a
[Severity: Low]
Is this rationale still accurate after the v4 change? In v4,
test_pin_priority_get_set() first writes the current value back, and
returns if the device refuses it:
if ! dpll_pin_set_prio "$DPLL_DEV_ID" "$PIN_TUNE_ID" "$before"; then
...
return
fi
So a current value outside the settable range, such as 255 on ice, ends
the test before the candidate loop runs. The fallback to 1 and 7 now
matters only when before is 0, or when the device accepts its current
value back but refuses before - 1.
Also, "the small values every driver accepts" is followed by "A driver may
still refuse all of them". These two statements contradict each other.
> The standard device lays its inputs out as gnss0 with priority 0 and
> ext0 with priority 1, and the stress devices get random priorities on
> their input pins.
create_stress_device() gives ext0 a fixed priority of 1, and
test_deploy_cycle() uses the fixed values 0 and 1. Could the message say
that only the extra input pins of the stress device get random
priorities?
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index 0a00a18bded2c..f7340bd89602f 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
[ ... ]
> @@ -70,6 +71,79 @@ pin_tune_capable()
> return 1
> }
>
> +test_pin_priority_get_set()
> +{
[ ... ]
> + pin_tune_capable priority-can-change "DPLL pin priority set/get" \
> + "priority cannot change" || return
> +
> + before=$(dpll_pin_get_prio "$DPLL_DEV_ID" "$PIN_TUNE_ID")
> + if [ -z "$before" ]; then
> + dpll_log_test_skip_or_fail "DPLL pin priority set/get" \
> + "prio not reported"
> + return
> + fi
[Severity: Low]
Should the exit status of dpll_pin_get_prio() be checked here? When the
dpll tool fails, __dpll_pin_dev_field() returns 1 with empty output:
out=$(dpll pin show id "$pin_id" -j 2>/dev/null) || return 1
So a failed query and a pin with no prio in its parent-device nest both
end up as "prio not reported". On a device provided by the user, that is
logged as a skip, not a failure.
pin_tune_capable(), just above, already tells a failed query apart from a
missing capability. The later frequency and phase adjust tests in the
series also make that distinction for their getters.
> + # A device may report a priority it does not accept back, one that
> + # marks an unused pin for instance, and the pin could not be
> + # restored then. Writing the current value changes nothing, so
> + # that is tried before the pin is touched.
[ ... ]
> + # The accepted range is not advertised, so try one below the current
> + # value and then small values, a refusal of all of them is a skip on
> + # a device the user provided, the simulator accepts every value
> + # tried here.
> + target=""
> + for candidate in $((before - 1)) 1 7; do
> + [ "$candidate" -ge 0 ] && [ "$candidate" != "$before" ] ||
> + continue
> + if dpll_pin_set_prio "$DPLL_DEV_ID" "$PIN_TUNE_ID" \
> + "$candidate"; then
> + target=$candidate
> + break
> + fi
> + reason=${DPLL_LAST_ERR%%$'\n'*}
> + done
> + if [ -z "$target" ]; then
> + dpll_log_test_skip_or_fail "DPLL pin priority set/get" \
> + "cannot set a new prio${reason:+, $reason}"
> + return
> + fi
> + after=$(dpll_pin_get_prio "$DPLL_DEV_ID" "$PIN_TUNE_ID")
> + if [ "$after" != "$target" ]; then
> + check_err 1 "priority expected $target, got '$after'"
> + fi
[Severity: Medium]
Can this candidate order make the device switch its reference in
automatic mode? pin_is_spare() accepts a pin whose state is selectable:
(.state == "disconnected" or
.state == "selectable")) and
A lower number means a higher priority. Both before - 1 and then 1 move
the spare pin toward or above the current reference.
For example, take a reference at prio 2 and a spare pin at prio 3. Then
before - 1 ties with the reference, and 1 puts the spare pin above it.
Candidate 7 is tried whenever before is not 7. So when before < 7, it
lowers the priority instead.
After the set, only the prio is read back and the pin state is not
checked. A reference switch on hardware (ice, or zl3073x when the ref is
selectable) would go unnoticed.
On a non-revertive device, the switch can remain after the deferred
restore, and the restore still reports success.
There is also no re-check like the one in test_pin_state_transitions():
if [ "$mode" = automatic ] && [ "$before" = connected ]; then
dpll_log_test_skip_or_fail "DPLL pin state transitions" \
"spare input pin became the reference"
return
fi
test_pin_state_transitions() runs first. Through its
automatic/selectable/connected exception, it accepts the pin being left
connected.
Could test_pin_priority_get_set() then change the priority of what is now
the device's reference? When before < 7, it would lower that priority
with 7.
The script header warns that a spare pin with a valid signal can still be
selected. Would it make sense to try values that lower the priority
first, or to check the pin state before and after the set?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112130359.840795-1-poros%40redhat.com
next prev parent 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 [this message]
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
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=179483940380.3136.1462332477683774177@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