Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Sun, 29 Nov 2026 10:38
Re: [PATCH net-next v5 08/14] selftests: dpll: add pin priority test
Author: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 10:38
Date: Sun, 29 Nov 2026 10:38
140 lines
12811 bytes
12811 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] 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
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