Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] dpll_stress.sh now exits with KSFT_SKIP (4) on every kernel
where the DPLL reference tracker is missing or unconfirmed, even when…
- [Low] dpll_ref_tracker_probe() in dpll_lib.sh deletes its probe device
and then clears only DPLLSIM_PROBE_DEVICE.
--
selftests: dpll: add reference leak tests
This adds library helpers to the dpll selftests. They snapshot the
ref_tracker debugfs entries for DPLL devices and pins, and they report
entries created after the snapshot that still hold references once the
test devices are removed. A throwaway probe device checks whether the
tracker works. The probe runs first in dpll_stress.sh, which also gains a
final leak check, and it also runs in the new dpll_reftrack.sh script.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_lib.sh b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> index 13b57e31593cd..0ca33dc75b125 100644
> --- a/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
[ ... ]
> @@ -824,3 +842,390 @@ dpllsim_setup_standard_device()
> return 1
> fi
> }
[ ... ]
> +dpll_ref_tracker_probe()
> +{
> + local file=$1
> + local name attempt ret=2
> +
> + dpll_ref_tracker_snapshot "$file"
[ ... ]
> + for attempt in 1 2 3; do
> + dpllsim_alloc_clock_id
> + name="probe$DPLLSIM_CLOCK_ID"
> + dpllsim_create_device "$name" "$DPLLSIM_CLOCK_ID" && break
[ ... ]
> + done
> + DPLLSIM_PROBE_DEVICE=$name
> +
> + if dpllsim_add_pin "$name" ext0 ext 10000000 input &&
> + dpllsim_deploy "$name"; then
> + ret=1
> + [ -n "$(__dpll_ref_tracker_new_entries "$file")" ] && ret=0
> + fi
> +
> + if dpllsim_delete_device "$name"; then
> + DPLLSIM_PROBE_DEVICE=""
[Severity: Low]
Should DPLLSIM_CREATED_NAME be cleared here too? dpllsim_create_device()
set it to probe<id>. After a successful delete, only DPLLSIM_PROBE_DEVICE
is reset.
In dpll_reftrack.sh with REF_TRACKER set to 0, test_basic_reftrack()
returns before it creates a device, so nothing overwrites the name. At
exit, cleanup() then runs this against the probe<id> path that the run
already removed:
if [ -n "$DPLLSIM_CREATED_NAME" ]; then
dpllsim_delete_device "$DPLLSIM_CREATED_NAME" ||
log_info "cannot delete device $DPLLSIM_CREATED_NAME"
fi
dpllsim_delete_device() returns 0 for a missing directory, so this is
usually a no-op.
However, dpllsim_create_device() refuses an existing directory so that a
directory created by something else is never recorded as a device of this
run. Suppose something outside the lock creates a probe<id> directory
after the probe deletes its device and before the script exits. Could
the exit handler then undeploy and remove that directory?
destroy_device() in test_basic_reftrack() appears to leave the same stale
record for the device created by dpllsim_setup_standard_device(). A fix
that clears DPLLSIM_CREATED_NAME after a successful delete might need to
cover both paths. cleanup() in dpll_stress.sh reads DPLLSIM_CREATED_NAME
the same way.
> + else
> + log_info "cannot delete device $name"
> + return 4
> + fi
[ ... ]
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_stress.sh b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> index 1474e1b98540d..dd11c0818d3cf 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> @@ -12,11 +12,13 @@ source "$SCRIPTDIR/../../net/lib.sh"
> source "$SCRIPTDIR/dpll_lib.sh"
>
> ALL_TESTS="
> + dpll_test_ref_tracker_probe
> test_rapid_create_delete
> test_concurrent_workers
> test_pin_state_flooding
> test_many_devices
> test_deploy_cycle
> + test_ref_leaks
> "
[Severity: Medium]
Will dpll_stress.sh now report SKIP as its overall result on kernels
without CONFIG_DPLL_REFCNT_TRACKER, even when all five stress tests pass?
On those kernels, dpll_test_ref_tracker_probe() ends in log_test_skip()
for one of two reasons. Either debugfs or the ref_tracker directory is
missing ("ref_tracker debugfs not available"), or CONFIG_REF_TRACKER is
enabled by another option ("no DPLL reference tracked"). Either way,
REF_TRACKER stays 0, and test_ref_leaks() logs a second skip ("reference
tracker not confirmed by the probe").
log_test() merges each result into EXIT_STATUS:
tools/testing/selftests/net/lib.sh:ksft_exit_status_merge() {
...
__ksft_status_merge "$a" "$b" \
$ksft_xfail $ksft_pass $ksft_skip $ksft_fail
}
Skip ranks above pass, so one skip raises EXIT_STATUS from 0 to
ksft_skip, and the script ends with exit $EXIT_STATUS.
Before this patch, dpll_stress.sh had no skip path, so on these kernels
it exited 0. Could the ref_tracker probe and final check be kept out of
the stress script's merged exit status when the tracker is just not
built in, or be left to dpll_reftrack.sh alone?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40redhat.com