Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] On an Intel E810-T device that the user provides (DPLL_DEV_ID
/ DPLL_DRIVER=ice), dpll_features.sh can pick U.FL2 as PIN_TUNE_ID.
--
selftests: dpll: add pin state tests
This adds dpll_features.sh. It picks a spare input pin, moves it between
disconnected and selectable, reads the state back after each step and
restores it at the end. By default it runs against a dpllsim device, or
against a device given by DPLL_DEV_ID or DPLL_DRIVER. The library gains
a pin state setter and getters for the device mode and pin operstate,
and the stress script gains a test that floods pin state changes.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> new file mode 100755
> index 0000000000000..9dcf53d019987
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> @@ -0,0 +1,500 @@
[ ... ]
> + if ! dpll_pin_set_state "$DPLL_DEV_ID" "$PIN_TUNE_ID" "$before"; then
> + reason=${DPLL_LAST_ERR%%$'\n'*}
> + reason=${reason:+, $reason}
> + if [ "$RET" -eq 0 ]; then
> + dpll_log_test_skip_or_fail \
> + "DPLL pin state transitions" \
> + "cannot set pin state to $before$reason"
> + return
> + fi
> + check_err 1 "cannot restore pin state$reason"
> + else
> + TUNE_CHANGED=0
> + fi
> + # The automatic selection may pick a pin that is selectable again,
> + # like it may in the loop above. A pin that shares its input with
> + # another one, as U.FL2 does with SMA2 on E810-T, reads
> + # disconnected once it is restored, while the partner pin stays
> + # changed, so the readback cannot tell it from a pin that was
> + # restored cleanly, the sharing is what the interface does not
> + # show, see the script header.
> + after=$(dpll_pin_get_state "$DPLL_DEV_ID" "$PIN_TUNE_ID")
> + if [ -z "$after" ]; then
> + check_err 1 "cannot read the restored pin state back"
> + elif [ "$after" != "$before" ] &&
> + [ "$may_pick/$before/$after" != 1/selectable/connected ]; then
> + check_err 1 "pin state not restored, got '$after'"
> + fi
> +
> + log_test "DPLL pin state transitions"
> +}
[Severity: Medium]
On an E810-T device given through DPLL_DEV_ID or DPLL_DRIVER=ice, can
this test leave the SMA2 connector reconfigured and still report PASS?
When SMA2 is an input that is not the reference, U.FL2 is inactive and
reads disconnected. pin_is_spare() accepts it. pin_ranks_below_refs()
also passes when the reference ranks above the CGU input that the two
pins share. So pick_tune_pin() can choose U.FL2 when no earlier input
qualifies.
The loop in test_pin_state_transitions() then sets U.FL2 to selectable,
and the final restore sets it back to disconnected. In
ice_dpll_ufl_pin_state_set() those two transitions do:
case ICE_DPLL_PIN_SW_2_IDX:
if (state == DPLL_PIN_STATE_SELECTABLE) {
data |= ICE_SMA2_DIR_EN;
data &= ~ICE_SMA2_UFL2_RX_DIS;
enable = true;
} else if (state == DPLL_PIN_STATE_DISCONNECTED) {
...
data |= ICE_SMA2_UFL2_RX_DIS;
enable = false;
The disconnected branch never clears ICE_SMA2_DIR_EN, and it disables
the shared CGU input. After the test, ice_dpll_sw_pins_update() reports
SMA2 differently:
else if (data & ICE_SMA2_DIR_EN)
p->direction = DPLL_PIN_DIRECTION_OUTPUT;
SMA2 shows up as an output, or as inactive if TX_EN was set, where it
used to be an input. If TX_EN was clear, SMA2 is now an active output on
a connector that may be wired to external equipment as an input.
U.FL2 itself reads back disconnected, which matches $before, so the
readback passes and log_test reports PASS. The deferred tune_restore
covers only PIN_TUNE_ID.
Is the comment right that the interface does not show the sharing? The
script header says the same thing. ice calls
ice_dpll_sw_pin_notify_peer() after the set, and the change to SMA2's
direction and state is visible in dpll pin show.
Could the test dump the other pins of the device before the first set
and compare them after the restore? It could then fail, or skip a pin
whose state change rewires another pin, rather than only documenting
the risk in the header.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40redhat.com