# Re: \[PATCH net-next v2 12/14\] selftests: dpll: add pin phase adjust test

- From: Ivan Vecera \<ivecera@redhat.com\>
- Date: 2026-11-06 10:51:51 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/11/17877452
- Thread: https://ratatoskr.run/netdev/2026/11/17871508/t.md

```text
On 11/5/26 16:18, Petr Oros wrote:
> Add a test that reads the phase adjustment range and granularity a
> pin advertises, picks the largest multiple of the granularity inside
> the range, or the smallest one when that is already the current value,
> sets it, reads it back and restores the original value. It skips when
> the dpll tool lacks the phase-adjust keyword of pin set and when the
> range is too narrow to pick a different value. A pin that reports no
> phase adjustment or no range is a skip on a device provided by the user
> and a failure on the device the script created, whose pins report
> both.
>
> The core refuses a value that is not a multiple of the granularity a
> driver reports, the current value included, so a pin that sits at such
> a value could not be put back. The test bails out on that before it
> schedules the restore, which is deferred right after so that an
> interrupted run restores the value too.
>
> The granularity is only reported by drivers that have the core enforce
> one. Without it the target is computed with a granularity of 1, and a
> driver may refuse it for a granularity of its own or for any other
> constraint the interface does not advertise. A refused set is therefore
> 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 every value its range and granularity allow. The
> test ends there, a value that was not set has nothing to read back.
>
> Signed-off-by: Petr Oros <redacted>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>

```
