Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Mon, 16 Nov 2026 14:29
Re: [PATCH net-next v4 02/14] selftests: dpll: add test library and device lifecycle tests
Author: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:29
Date: Mon, 16 Nov 2026 14:29
155 lines
13185 bytes
13185 bytes
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] When dpllsim is built in (CONFIG_DPLLSIM=y), the selftests
cannot find their own devices and report a hard FAIL where they should…
- [Low] A second signal can still abort the exit-trap teardown, despite
the comment in cleanup().
--
selftests: dpll: add test library and device lifecycle tests
This adds a shell library for the DPLL selftests. It wraps the iproute2
dpll tool and the dpllsim configfs interface, and the patch also adds
dpll_basic.sh and dpll_stress.sh. The library finds simulated devices by
clock ID and module name, and each script takes a lock, mounts configfs
when needed and cleans up from an exit trap.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_lib.sh b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> new file mode 100644
> index 0000000000000..9fe7f2f62dd46
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
[ ... ]
> +# $1: clock-id, $2: module name (optional)
> +dpll_device_get_id_by_clock_id()
> +{
> + local clock_id=$1
> + local module=${2:-}
> + local out
> +
> + out=$(dpll device show -j 2>/dev/null) || return 1
> + jq -r --arg cid "$clock_id" --arg mod "$module" \
> + '[.device[]? |
> + select((.["clock-id"] | tostring) == $cid and
> + ($mod == "" or .["module-name"] == $mod))
> + ][0].id // empty' <<< "$out"
> +}
[Severity: Medium]
Does this module-name match work when dpllsim is built in?
DPLLSIM is a tristate. With CONFIG_DPLLSIM=y, THIS_MODULE is NULL, and
dpllsim registers its device with:
drivers/dpll/dpllsim/dpll.c:dpllsim_dev_deploy() {
...
dpll = dpll_device_get(sim->clock_id, 0, THIS_MODULE, &sim->tracker);
...
}
The netlink reply then carries:
drivers/dpll/dpll_netlink.c:dpll_device_get_one() {
...
if (nla_put_string(msg, DPLL_A_MODULE_NAME, module_name(dpll->module)))
...
}
module_name() returns "kernel" for a NULL module. With mod=dpllsim, the
select above never matches a device the script created.
dpllsim_available() still counts a built-in simulator as available. Once
/sys/kernel/config/dpllsim exists it returns 0, and it ignores the
modprobe result:
[ -d "$DPLLSIM_CFG" ] && return 0
So the scripts create and deploy a device that their own lookup cannot
find:
In dpll_basic.sh, dpllsim_setup_standard_device() calls
dpll_device_wait_by_clock_id "$clock_id" dpllsim. busywait runs until
BUSYWAIT_TIMEOUT, and the script then prints "FAIL: cannot create dpllsim
device" and exits with ksft_fail.
In dpll_stress.sh, test_deploy_cycle() fails on its first iteration with
"device not on netlink".
The default branch of dpll_lib_init() has a related problem:
select(.["module-name"] != "dpllsim")
This does not exclude a leftover built-in dpllsim device, so that device
would be tested as if it were hardware.
The later patches in the series (the pin flooding and many-devices tests)
still use the same module-name filter, so they do not fix this.
Could the lookups handle a built-in dpllsim, or should the scripts skip
when dpllsim is not a module?
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_stress.sh b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> new file mode 100755
> index 0000000000000..01d57ab0172b0
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
[ ... ]
> +cleanup()
> +{
> + local dev
> +
> + # A second signal must not abort the teardown half way.
> + trap '' INT TERM
[Severity: Low]
Can a second signal still abort the teardown here? The script sets up its
traps like this:
trap cleanup EXIT
trap 'exit 1' INT TERM
The INT/TERM handler stays "exit 1" until cleanup() itself runs
trap '' INT TERM, and here "local dev" runs before that.
If another INT or TERM is handled at that command boundary, exit 1 runs
inside the EXIT trap. bash does not run the EXIT trap a second time, so
the shell exits without running:
- the CREATED_DEVICES loop
- the DPLLSIM_CREATED_NAME delete
- dpll_lib_cleanup()
The simulated devices and the configfs mount from this run would then be
left behind.
dpll_basic.sh uses the same trap pattern. Its cleanup() runs the ignore
first, which makes the window smaller but does not remove it.
The window is still there at the end of the series. There, cleanup() in
dpll_stress.sh runs "local pid dev base" and "local pids=() shell_jobs=()"
before the ignore.
Would it be better to ignore the signals in the handler itself? For
example:
trap 'trap "" INT TERM; exit 1' INT TERM
Or at least make the ignore the first statement of every cleanup()?
--
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