Netdev List
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: netdev@vger.kernel.org
Cc: Petr Oros <poros@redhat.com>,
	Chris du Quesnay <Chris.duQuesnay@microchip.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
	Paolo Abeni <pabeni@redhat.com>,
	Prathosh Satish <Prathosh.Satish@microchip.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 3/3] dpll: zl3073x: add PTP clock support
Date: Fri, 31 Jul 2026 18:23:24 +0200	[thread overview]
Message-ID: <b9175d00-7580-45d0-95f2-325f19a9aa89@redhat.com> (raw)
In-Reply-To: <20260730132150.371376-4-ivecera@redhat.com>

Replies to Sashiko's findings:

 > Is a hard dependency on PTP_1588_CLOCK required here?
 > ...
 > Would "depends on NET && PTP_1588_CLOCK_OPTIONAL" work instead?

This was changed from OPTIONAL to a hard dependency at Jakub's
explicit request in v2 review [1]. His rationale is that OPTIONAL is
meant for NICs where PTP is truly a side-feature, while this is a
dedicated DPLL/PTP device. Non-PTP chip variants simply skip PTP
clock registration.

[1] https://lore.kernel.org/netdev/20260727125921.2e16bed9@kernel.org/

 > does the kernel-doc match the implementation?
 > The body has a third gating condition ... zl3073x_chan_is_out_stepped()
 >
 > Can two perout channels end up aliasing the same physical output?
 > ...
 > Related: for single-ended N-divided formats, is the P-pin channel
 > usable at all? ... out.esync_n_period ... truncates to 0
 >
 > Is reporting success for a disable request that does nothing the
 > intended behaviour?
 >
 > How are the two userspace interfaces that can now program this output
 > pin meant to coordinate?

Will drop perout from this series entirely. The current pin-based
design has the P/N aliasing and N-divided truncation issues you
identified, and the disable path needs rework to use the hardware's
glitchless stop mechanism (output_ctrl stop bit). Will rework perout
as a follow-up with an output-based design: one perout channel per
physical output, eligibility checks in the enable callback, proper
stop/start via output_ctrl, and output divisor restore on disable.

 > Does settime64 need to compensate for the next-1 Hz load latency?

This is a known hardware characteristic. settime64 is used for large
absolute time sets (boot, initial synchronization) where sub-second
precision is not critical. The PTP servo uses adjtime/adjphase for
fine control, both of which handle the 1 Hz boundary correctly. This
matches the behavior of other I2C/SPI-attached PHC drivers (e.g.
ptp_clockmatrix) that have the same HW constraint.

 > Can delta * synth_freq overflow s64 here?
 > For delta == S64_MIN the negation wraps, so abs() returns S64_MIN

Real bug. abs(S64_MIN) is undefined behavior and wraps to S64_MIN
on two's complement, bypassing the >= NSEC_PER_SEC split. Will add
an explicit guard at the top of adjtime.

 > Should a partial phase step really report success?
 > ...
 > There, clock_adjtime(ADJ_SETOFFSET) reports success while up to
 > ~999 ms of the requested step was never applied.

This is intentional. The seconds part is already committed via ToD
read-modify-write and cannot be rolled back. Reporting an error
would cause the PTP servo to retry the full delta, applying the
seconds adjustment again. The sub-second residual self-corrects in
the next servo cycle. A dev_warn is emitted so the condition is not
silent.

The same reasoning applies to the partial phase step case: the ToD
counter and some output groups are already stepped, so reporting
success with a warning is the lesser evil compared to a retry that
doubles the seconds adjustment.

 > Does first_synth_freq match what the comment describes?
 > ...
 > On a multi-channel device those can be different synths

The code is correct - first_synth_freq is the lowest-ID synth
assigned to this DPLL channel, which is the one the firmware uses
for the ToD-only conversion. Will clarify the comment.

Regarding the empty output mask with tod_step: this is a documented
firmware feature. When output mask is 0 and tod_step is set, the
firmware steps only the ToD counter using the first assigned synth's
clock period for the cycle-to-time conversion.

Thanks,
Ivan


      reply	other threads:[~2026-07-31 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 13:21 [PATCH net-next v3 0/3] dpll: zl3073x: add PTP clock support Ivan Vecera
2026-07-30 13:21 ` [PATCH net-next v3 1/3] dpll: zl3073x: add channel ToD, phase step and TIE operations Ivan Vecera
2026-07-31 16:20   ` Ivan Vecera
2026-07-30 13:21 ` [PATCH net-next v3 2/3] dpll: zl3073x: refactor output pin frequency set for internal use Ivan Vecera
2026-07-30 13:21 ` [PATCH net-next v3 3/3] dpll: zl3073x: add PTP clock support Ivan Vecera
2026-07-31 16:23   ` Ivan Vecera [this message]

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=b9175d00-7580-45d0-95f2-325f19a9aa89@redhat.com \
    --to=ivecera@redhat.com \
    --cc=Chris.duQuesnay@microchip.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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=richardcochran@gmail.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