From: Ivan Vecera <ivecera@redhat.com>
To: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@intel.com>,
Jakub Kicinski <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
Prathosh Satish <Prathosh.Satish@microchip.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2] dpll: zl3073x: Allow to use custom phase measure averaging factor
Date: Wed, 17 Sep 2025 14:18:16 +0200 [thread overview]
Message-ID: <c60779d6-938d-4adc-a264-2d78fb3c5947@redhat.com> (raw)
In-Reply-To: <SA1PR11MB844643902755174B7D7E9B3F9B17A@SA1PR11MB8446.namprd11.prod.outlook.com>
On 17. 09. 25 1:26 odp., Kubalewski, Arkadiusz wrote:
>> From: Jakub Kicinski <kuba@kernel.org>
>> Sent: Tuesday, September 16, 2025 1:47 AM
>>
>> cc: Arkadiusz
>>
>> On Thu, 11 Sep 2025 09:23:01 +0200 Ivan Vecera wrote:
>>> The DPLL phase measurement block uses an exponential moving average,
>>> calculated using the following equation:
>>>
>>> 2^N - 1 1
>>> curr_avg = prev_avg * --------- + new_val * -----
>>> 2^N 2^N
>>>
>>> Where curr_avg is phase offset reported by the firmware to the driver,
>>> prev_avg is previous averaged value and new_val is currently measured
>>> value for particular reference.
>>>
>>> New measurements are taken approximately 40 Hz or at the frequency of
>>> the reference (whichever is lower).
>>>
>>> The driver currently uses the averaging factor N=2 which prioritizes
>>> a fast response time to track dynamic changes in the phase. But for
>>> applications requiring a very stable and precise reading of the average
>>> phase offset, and where rapid changes are not expected, a higher factor
>>> would be appropriate.
>>>
>>> Add devlink device parameter phase_offset_avg_factor to allow a user
>>> set tune the averaging factor via devlink interface.
>>
>> Is averaging phase offset normal for DPLL devices?
>> If it is we should probably add this to the official API.
>> If it isn't we should probably default to smallest possible history?
>>
>
> AFAIK, our phase offset measurement uses similar mechanics, but the algorithm
> is embedded in the DPLL device FW and currently not user controlled.
> Although it might happen that one day we would also provide such knob,
> if useful for users, no plans for it now.
> From this perspective I would rather see it in dpll api, especially
> this relates to the phase measurement which is already there, the value
> being shared by multiple dpll devices seems HW related, but also seem not a
> problem, as long as a change would notify each device it relates with.
What if the averaging is implemented in different HW differently? As I
mentioned the Microchip HW uses exponential moving average but
a different HW can do it differently.
> Does frequency offset measurement for EEC DPLL would also use the same value?
Nope, this only affects phase offset measurement. AFAIK there is no such
tuning knob for FFO or frequency measurement in general...
Is it correct Prathosh?
Thanks,
Ivan
next prev parent reply other threads:[~2025-09-17 12:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 7:23 Ivan Vecera
2025-09-15 23:46 ` Jakub Kicinski
2025-09-16 18:16 ` Ivan Vecera
2025-09-16 22:25 ` Jakub Kicinski
2025-09-17 11:26 ` Kubalewski, Arkadiusz
2025-09-17 12:18 ` Ivan Vecera [this message]
2025-09-17 13:10 ` Kubalewski, Arkadiusz
2025-09-17 14:55 ` Ivan Vecera
2025-09-17 17:01 ` Vadim Fedorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c60779d6-938d-4adc-a264-2d78fb3c5947@redhat.com \
--to=ivecera@redhat.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®