From: Ivan Vecera <ivecera@redhat.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, min.li@microchip.com,
vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com,
jiri@resnulli.us, kuba@kernel.org, Prathosh.Satish@microchip.com,
pabeni@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 2/4] dpll: zl3073x: make embedded sync follow the output carrier frequency
Date: Fri, 9 Oct 2026 20:43:14 +0200 [thread overview]
Message-ID: <0fc24fc1-533f-4bc3-9ac3-d36e1d65dadc@redhat.com> (raw)
In-Reply-To: <179147350298.434549.8122554224626691119@kernel.org>
On 10/8/26 17:31, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 2 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] zl3073x_dpll_output_pin_esync_get()
> (drivers/dpll/zl3073x/dpll.c) now returns esync->freq = 1 and…
> - [Medium] The fix for the 'stuck-on' eSync only works when the driver's
> own frequency_set() moves the carrier to 1 Hz.
>
> --
>
> dpll: zl3073x: make embedded sync follow the output carrier frequency
>
> This patch moves the eSync handling into zl3073x_out_esync_{is_enabled,
> enable,disable}() helpers and uses them from the esync get/set callbacks.
> On non-N-divided outputs, a frequency change now recomputes the eSync
> period and width, or disables eSync when the new carrier is 1 Hz.
> esync_get() now reports a nominal 1 Hz / 25% whenever the clock type is
> ESYNC.
>
>> diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c
>> index f2e137475b40f..7c997966c3c33 100644
>> --- a/drivers/dpll/zl3073x/dpll.c
>> +++ b/drivers/dpll/zl3073x/dpll.c
>
> [ ... ]
>
>> @@ -864,38 +864,28 @@ zl3073x_dpll_output_pin_esync_get(const struct dpll_pin *dpll_pin,
>> * for N-division is also used for the esync divider so both cannot
>> * be used.
>> */
>> - if (zl3073x_out_is_ndiv(out))
>> + if (zl3073x_out_is_ndiv(out) || !pin->esync_control)
>> return -EOPNOTSUPP;
>>
>> /* Get attached synth frequency */
>> synth = zl3073x_synth_state_get(zldev, zl3073x_out_synth_get(out));
>> synth_freq = zl3073x_synth_freq_get(synth);
>> - out_freq = synth_freq / out->div;
>>
>> - if (!pin->esync_control || out_freq <= 1)
>> + /* The esync is not supported for 1 Hz base frequency */
>> + if (synth_freq / out->div <= 1)
>> return -EOPNOTSUPP;
>
> [Severity: Medium]
> Can eSync still get stuck on if the output already has the ESYNC clock
> type on a 1 Hz carrier when the driver probes?
eSync on a 1 Hz carrier needs output_esync_period = 1, which the
datasheet defines as undefined. Such a state in flash is an invalid
configuration and the driver does not try to recover from it. The
patch only makes sure the driver itself never creates it.
> The commit message mentions configurations "left in flash or by an older
> kernel". zl3073x_out_state_fetch() keeps the mode register exactly as it
> reads it from the device. So this state can exist without the driver's
> own frequency_set() ever having run.
>
> In that case this check returns -EOPNOTSUPP even though eSync is enabled.
> dpll_pin_esync_set() then returns before it reaches the driver's disable
> path:
>
> drivers/dpll/dpll_netlink.c:dpll_pin_esync_set() {
> ...
> ret = ops->esync_get(pin, dpll_pin_on_dpll_priv(dpll, pin), dpll,
> dpll_priv(dpll), &esync, extack);
> if (ret) {
> NL_SET_ERR_MSG(extack, "unable to get current embedded sync frequency value");
> return ret;
> }
> ...
> }
>
> The new disable branch in zl3073x_dpll_output_pin_frequency_set() can't
> be reached either. The core short-circuits a request for 1 Hz on a pin
> that is already at 1 Hz:
>
> drivers/dpll/dpll_netlink.c:dpll_pin_freq_set() {
> ...
> if (freq == old_freq)
> return 0;
> ...
> }
>
> The only escape seems to be: move the pin to another supported frequency,
> disable eSync, then go back to 1 Hz. That doesn't work if 1 Hz is the
> only frequency the pin supports.
>
> Could the driver clear the ESYNC clock type at fetch time when the carrier
> is 1 Hz or less? Alternatively, esync_get() could report an enabled eSync
> so that it can be turned off.
>
>>
>> esync->range = esync_freq_ranges;
>> esync->range_num = ARRAY_SIZE(esync_freq_ranges);
>>
>> - if (zl3073x_out_clock_type_get(out) != ZL_OUTPUT_MODE_CLOCK_TYPE_ESYNC) {
>> - /* No need to read esync data if it is not enabled */
>> + if (zl3073x_out_esync_is_enabled(out)) {
>> + esync->freq = 1;
>> + esync->pulse = 25;
>
> [Severity: Medium]
> Does reporting a fixed 1 Hz here stop the core from correcting a
> mismatched eSync?
Agreed. I will drop the fixed 1 Hz / 25% reporting and derive the
frequency and pulse from the registers again in V4. The pulse should
be also computed in 64 bits, as 50 * esync_n_width can overflow u32.
Thanks,
Ivan
pw-bot: cr
next prev parent reply other threads:[~2026-10-09 18:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 15:31 [PATCH net v3 0/4] dpll: zl3073x: fix output pin frequency, esync and sibling notifications Ivan Vecera
2026-10-06 15:31 ` [PATCH net v3 1/4] dpll: zl3073x: reject output frequencies with too small divisor Ivan Vecera
2026-10-07 18:51 ` Petr Oros
2026-10-08 15:31 ` netdev-bot+sashiko
2026-10-09 18:40 ` Ivan Vecera
2026-10-06 15:31 ` [PATCH net v3 2/4] dpll: zl3073x: make embedded sync follow the output carrier frequency Ivan Vecera
2026-10-07 18:54 ` Petr Oros
2026-10-08 15:31 ` netdev-bot+sashiko
2026-10-09 18:43 ` Ivan Vecera [this message]
2026-10-06 15:31 ` [PATCH net v3 3/4] dpll: zl3073x: reject inexact frequencies for N-divided outputs Ivan Vecera
2026-10-07 18:55 ` Petr Oros
2026-10-08 15:31 ` netdev-bot+sashiko
2026-10-09 18:48 ` Ivan Vecera
2026-10-06 15:31 ` [PATCH net v3 4/4] dpll: zl3073x: notify sibling pin when shared output config changes Ivan Vecera
2026-10-07 18:55 ` Petr Oros
2026-10-08 15:31 ` netdev-bot+sashiko
2026-10-09 18:51 ` Ivan Vecera
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=0fc24fc1-533f-4bc3-9ac3-d36e1d65dadc@redhat.com \
--to=ivecera@redhat.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.li@microchip.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vadim.fedorenko@linux.dev \
/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®