# Re: \[PATCH net-next v2 01/14\] dpll: dpllsim: Add simulated DPLL device driver

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

```text
On 11/5/26 16:18, Petr Oros wrote:
> Add dpllsim, a driver providing simulated DPLL devices for testing the
> DPLL subsystem and its userspace tooling without real hardware, in the
> same spirit as netdevsim for network devices. The DPLL core identifies
> a device by clock ID, index and module only, so the driver needs no bus
> and no struct device at all.
>
> Instances are created and configured at runtime through configfs,
> following the gpio-sim precedent for objects that userspace creates on
> demand. Creating a directory under/sys/kernel/config/dpllsim/ allocates
> an instance, its clock_id attribute selects the clock ID, writing 1 to
> live registers the DPLL device with the core and writing 0 unregisters
> it again. Removing the directory tears a live instance down implicitly.
> Keeping registration separate from creation lets a test register and
> unregister the same device repeatedly, which is where the core bugs the
> driver is meant to catch tend to live, and it allows the structural
> attributes to be refused with EBUSY while the device is visible to
> userspace. Unlike sysfs, configfs does not imply a stable ABI, which
> suits a driver whose knobs exist only to drive tests.
>
> Reading live reports whether the device is registered with the DPLL
> subsystem, it turns 1 only once the whole live transition succeeded and
> 0 again as the first step of the teardown. The configuration is frozen
> earlier, from the moment the transition obtains the device handle, so
> that a configuration write racing with the transition is refused rather
> than lost.
>
> The device registers as a PPS type DPLL with the two mandatory callbacks
> only. mode_get reports automatic mode and lock_status_get reports
> unlocked with no error. Pins come with the following patches and the
> simulation of lock acquisition with a later series.
>
> Document the configfs layout under Documentation/driver-api and add a
> MAINTAINERS entry.
>
> Signed-off-by: Petr Oros<redacted>

Reviewed-by: Ivan Vecera <ivecera@redhat.com>

```
