Re: [PATCH net-next v2 1/3] dpll: add frequency monitoring to netlink spec

From: Ivan Vecera

Date: Wed Apr 01 2026 - 02:21:08 EST


Hi Kuba,

On 4/1/26 5:05 AM, Jakub Kicinski wrote:
On Mon, 30 Mar 2026 12:55:03 +0200 Ivan Vecera wrote:
Add DPLL_A_FREQUENCY_MONITOR device attribute to allow control over
the frequency monitor feature. The attribute uses the existing
dpll_feature_state enum (enable/disable) and is present in both
device-get reply and device-set request.

Add DPLL_A_PIN_MEASURED_FREQUENCY pin attribute to expose the measured
input frequency in Hz. The attribute is present in the pin-get reply.


+ -
+ name: frequency-monitor
+ type: u32
+ enum: feature-state
+ doc: Receive or request state of frequency monitor feature.

reads a bit clunkily - how about:

Current or desired state of the frequency monitor feature.

?

Agreed, will update.


+ If enabled, dpll device shall measure all currently available
+ inputs for their actual input frequency.
-
name: pin
enum-name: dpll_a_pin
@@ -456,6 +463,13 @@ attribute-sets:
Value is in PPT (parts per trillion, 10^-12).
Note: This attribute provides higher resolution than the standard
fractional-frequency-offset (which is in PPM).
+ -
+ name: measured-frequency
+ type: u64
+ doc: |
+ The measured frequency of the input pin in Hz.
+ This is the actual frequency being received on the pin,
+ as measured by the dpll device hardware.

If we make this a u64 should it be fixed point? Seems dubious that we'd
ever be able to measure >4Ghz frequencies, much more likely that we'd
want sub-1 precision ? So let's say this is fixed point 34.30 ?

Good point. I'm going with a decimal divider (1000) instead of 34.30, following the same approach as DPLL_PHASE_OFFSET_DIVIDER. The value
is now in millihertz (mHz) with a DPLL_PIN_MEASURED_FREQUENCY_DIVIDER
constant for userspace to extract integer and fractional parts.

Thanks,
Ivan