Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks under global dpll_lock

From: Jakub Kicinski

Date: Thu Nov 19 2026 - 16:39:04 EST


On Thu, 19 Nov 2026 13:29:11 +0100 Ivan Vecera wrote:
> > Right, for these level of waiting async seems like the right direction,
> > at least naively/without knowing the HW. Why does the device wait until
> > PPS to apply the step change? Is the programmed time supposed to
> > correspond to the pulse?
>
> Yes. The device has no immediate ToD write, it can only write the ToD
> on the next internal 1 Hz edge, the next input sync edge or the next
> internal 0.5 Hz edge. The written value is the time at that edge, so
> the seconds stay aligned with the 1 PPS outputs.
>
> Looking at it again, the zl3073x holds the channel lock while it waits
> for the edge, although the dpll callbacks do not touch the ToD, TIE or
> phase step registers, and they already run while the device applies
> such an operation, because the PTP ops return right after issuing it.
> I will look at narrowing the lock in the driver.
>
> For the resync, async is not only about reporting the result. Fast lock
> is a setting of the DPLL, not of a reference, and forcing it makes the
> DPLL ignore its frequency and phase error monitors. While an
> asynchronous resync is pending, everything else done to the DPLL runs
> in forced fast lock. A reference switch, whether from a priority or
> state change, a manual reference or the device itself in automatic
> mode, would follow the fast lock phase rate instead of the configured
> phase slope limit, and the resync would then report success on another
> reference. A switch to NCO would keep the force bit set until the work
> clears it. So every request changing the DPLL configuration would have
> to fail with -EBUSY, cancel the resync, or wait for it. With a lock per
> chip they simply wait, for at most 1 s.
>
> > Do the failures only happen because of "unforeseen circumstances" / EIO,
> > or there may be more common errors reported? If it's just the former
> > a devlink health reporter could be an option.
>
> For the output start and stop, only EIO. The device does not report a
> stopped output and the driver can only wait for one period, so a health
> reporter would work there.
>
>
> For the resync, no. The wait ends with -ETIMEDOUT when the DPLL does
> not enter fast lock, for example because the selected reference lost
> its qualification in the meantime. That is a result of the input
> signal the user needs in the reply, not a device fault.
>
> Beyond the zl3073x, with the global lock any callback that waits for
> its device, for example an mlx5 firmware command with its 60 s timeout,
> stalls the DPLL devices of every other driver in the system.

Well, I'm not convinced. The relations between objects in DPLL are
already quite hard to follow, and objects from one driver routinely
"plug" into objects from another. The explanation of the locking
rules in patch 9 does not look clean or clear. The driver facing
API needs to be much more "dummy-proof".