Re: [PATCH net-next v3 06/14] selftests: dpll: add pin state tests

From
Ivan Vecera <ivecera@redhat.com>
Date
2026-11-09 14:00:15
Also in
linux-doc, linux-kselftest
Reply to
Petr Oros, 2026-11-09
On 11/9/26 10:35, Petr Oros wrote:
Add dpll_features.sh, a script that exercises individual device and pin
callbacks with get/set roundtrips over netlink. It creates a dpllsim
device with the standard pin layout by default or runs against the
device named by DPLL_DEV_ID or the first device of the driver named by
DPLL_DRIVER, and picks the pin to reconfigure up front, the first input
pin that is not connected on the device, so that no test touches the
reference the device is locked to.

The first test moves that pin through the states of the device mode,
as Documentation/driver-api/dpll.rst defines them, reads the state back
after each step and restores the original state at the end. In
automatic mode these are disconnected and selectable, and on the
device the script created the test then checks that connected is
refused. Hardware drivers are not held to that, ice accepts connected
in automatic mode, and a pin with the state-connected-override
capability would take over the reference. In manual mode connected and
disconnected
are the states, connecting the pin makes it the reference, so the test
finds the pin connected before, connects it back at the end and checks
that it is the reference again.

A driver may refuse a state the capability promises, for a constraint
the interface does not tell. That is a skip on a device provided by
the user, with the reason the tool reported, and a failure on the
device the script created, whose simulator accepts both states of its
mode. The restores are deferred right after the original states are
read, and the cleanup handler of every script that defers runs the
pending restores before it removes the devices the script created, so
that an interrupted run puts the device back as well.

The stress script gains a test that floods one input pin of a fresh
device with changes between the states of automatic mode. The library
gains the state setter both use, which keeps the extack line of the
tool in DPLL_LAST_ERR so that a test can tell a refusal from a failure,
the device mode getter, and a check whether the pin set usage of the
tool knows a keyword, so that a test skips on a tool too old for it
rather than every script requiring a newer tool.

Signed-off-by: Petr Oros<redacted>
---
v3:
- follow the mode of the device under test: disconnected and
   selectable in automatic mode, where the simulator is checked to
   refuse connected, connected and disconnected in manual mode, where
   the pin connected before is connected back at the end
- cycle the state flooding test through the states of automatic mode
- add the device mode getter to the library
- honor DPLL_DRIVER like dpll_basic.sh does
- follow the move of the selftests to
   tools/testing/selftests/drivers/dpll
- the Reviewed-by and Acked-by of v2 are not carried over, the
   state test changed
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Thread (19 messages) 19 messages, 2 authors, last reply 22h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help