* [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign
@ 2026-02-05 18:10 Ivan Vecera
2026-02-06 14:04 ` Vadim Fedorenko
2026-02-07 4:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Ivan Vecera @ 2026-02-05 18:10 UTC (permalink / raw)
To: netdev
Cc: Prathosh Satish, Vadim Fedorenko, Arkadiusz Kubalewski,
Jiri Pirko, linux-kernel
The output pin phase adjustment functions incorrectly negate the phase
compensation value.
Per the ZL3073x datasheet, the output phase compensation register is
simply a signed two's complement integer where:
- Positive values move the phase later in time
- Negative values move the phase earlier in time
No negation is required. The erroneous negation caused phase adjustments
to be applied in the wrong direction.
Note that input pin phase adjustment correctly uses negation because the
hardware has an inverted convention for input references (positive moves
phase earlier, negative moves phase later).
Fixes: 6287262f761e ("dpll: zl3073x: Add support to adjust phase")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/dpll/zl3073x/dpll.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c
index 9879d85d29af..a8001c976038 100644
--- a/drivers/dpll/zl3073x/dpll.c
+++ b/drivers/dpll/zl3073x/dpll.c
@@ -1039,10 +1039,8 @@ zl3073x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *dpll_pin,
out_id = zl3073x_output_pin_out_get(pin->id);
out = zl3073x_out_state_get(zldev, out_id);
- /* Convert value to ps and reverse two's complement negation applied
- * during 'set'
- */
- *phase_adjust = -out->phase_comp * pin->phase_gran;
+ /* The value in the register is expressed in half synth clock cycles. */
+ *phase_adjust = out->phase_comp * pin->phase_gran;
return 0;
}
@@ -1064,10 +1062,8 @@ zl3073x_dpll_output_pin_phase_adjust_set(const struct dpll_pin *dpll_pin,
out_id = zl3073x_output_pin_out_get(pin->id);
out = *zl3073x_out_state_get(zldev, out_id);
- /* The value in the register is stored as two's complement negation
- * of requested value and expressed in half synth clock cycles.
- */
- out.phase_comp = -phase_adjust / pin->phase_gran;
+ /* The value in the register is expressed in half synth clock cycles. */
+ out.phase_comp = phase_adjust / pin->phase_gran;
/* Update output configuration from mailbox */
return zl3073x_out_state_set(zldev, out_id, &out);
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign
2026-02-05 18:10 [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign Ivan Vecera
@ 2026-02-06 14:04 ` Vadim Fedorenko
2026-02-06 15:02 ` Ivan Vecera
2026-02-07 4:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Vadim Fedorenko @ 2026-02-06 14:04 UTC (permalink / raw)
To: Ivan Vecera, netdev
Cc: Prathosh Satish, Arkadiusz Kubalewski, Jiri Pirko, linux-kernel
On 05/02/2026 18:10, Ivan Vecera wrote:
> The output pin phase adjustment functions incorrectly negate the phase
> compensation value.
>
> Per the ZL3073x datasheet, the output phase compensation register is
> simply a signed two's complement integer where:
> - Positive values move the phase later in time
> - Negative values move the phase earlier in time
>
> No negation is required. The erroneous negation caused phase adjustments
> to be applied in the wrong direction.
>
> Note that input pin phase adjustment correctly uses negation because the
> hardware has an inverted convention for input references (positive moves
> phase earlier, negative moves phase later).
Is it common for DPLLs to act this way?
>
> Fixes: 6287262f761e ("dpll: zl3073x: Add support to adjust phase")
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Anyways, with datasheet info being correctly read, the change LGTM
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign
2026-02-06 14:04 ` Vadim Fedorenko
@ 2026-02-06 15:02 ` Ivan Vecera
0 siblings, 0 replies; 4+ messages in thread
From: Ivan Vecera @ 2026-02-06 15:02 UTC (permalink / raw)
To: Vadim Fedorenko, netdev
Cc: Prathosh Satish, Arkadiusz Kubalewski, Jiri Pirko, linux-kernel
On 2/6/26 3:04 PM, Vadim Fedorenko wrote:
> On 05/02/2026 18:10, Ivan Vecera wrote:
>> The output pin phase adjustment functions incorrectly negate the phase
>> compensation value.
>>
>> Per the ZL3073x datasheet, the output phase compensation register is
>> simply a signed two's complement integer where:
>> - Positive values move the phase later in time
>> - Negative values move the phase earlier in time
>>
>> No negation is required. The erroneous negation caused phase adjustments
>> to be applied in the wrong direction.
>>
>> Note that input pin phase adjustment correctly uses negation because the
>> hardware has an inverted convention for input references (positive moves
>> phase earlier, negative moves phase later).
>
> Is it common for DPLLs to act this way?
I don't now if this is common for DPLLs but for ZL3073x family chips the
datasheet says:
<cite>
ref_phase_offset_compensation:
==============================
Phase offset compensation for references. The value is specified as a
signed two's complement, in units of ps. A positive value moves the
phase of any DPLL that locks to this reference earlier in time (more to
the left on a scope). A negative value moves the phase of any DPLL that
locks to this reference later in time (more to the right on a scope).
output_phase_compensation:
==========================
Output phase shift, expressed in 1/2 synth clock cycles. Two-complement
signed integer.
A positive value moves the phase of the output later in time (more to
the right on a scope). A negative value moves the phase earlier in time
(more to the left on a scope).
</cite>
So for input pins the value must be negated, while for output pins it
is not.
>>
>> Fixes: 6287262f761e ("dpll: zl3073x: Add support to adjust phase")
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>
> Anyways, with datasheet info being correctly read, the change LGTM
> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>
Thanks,
Ivan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign
2026-02-05 18:10 [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign Ivan Vecera
2026-02-06 14:04 ` Vadim Fedorenko
@ 2026-02-07 4:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-07 4:50 UTC (permalink / raw)
To: Ivan Vecera
Cc: netdev, Prathosh.Satish, vadim.fedorenko, arkadiusz.kubalewski,
jiri, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 5 Feb 2026 19:10:55 +0100 you wrote:
> The output pin phase adjustment functions incorrectly negate the phase
> compensation value.
>
> Per the ZL3073x datasheet, the output phase compensation register is
> simply a signed two's complement integer where:
> - Positive values move the phase later in time
> - Negative values move the phase earlier in time
>
> [...]
Here is the summary with links:
- [net] dpll: zl3073x: Fix output pin phase adjustment sign
https://git.kernel.org/netdev/net/c/5d41f95f5d0b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-07 4:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 18:10 [PATCH net] dpll: zl3073x: Fix output pin phase adjustment sign Ivan Vecera
2026-02-06 14:04 ` Vadim Fedorenko
2026-02-06 15:02 ` Ivan Vecera
2026-02-07 4:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox