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 08/14] selftests: dpll: add pin priority test
Author: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:30
Date: Mon, 16 Nov 2026 14:30
179 lines
14907 bytes
14907 bytes
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
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