mirror of https://lore.kernel.org/lkml/
 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>,
	Min Li <min.li@microchip.com>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/3] dpll: zl3073x: add channel ToD, phase step and TIE operations
Date: Sun, 9 Aug 2026 20:22:37 +0200	[thread overview]
Message-ID: <667c004b-6181-41c5-bea1-0a66e354bc96@redhat.com> (raw)
In-Reply-To: <20260807095826.386756-3-ivecera@redhat.com>

On 8/7/26 11:58 AM, Ivan Vecera wrote:
> Add low-level DPLL channel operations for ToD read/write/adjust,
> output phase step, delta frequency offset write and TIE (Time
> Interval Error) write. These serve as building blocks for the PTP
> clock callbacks added in the next patch.
> 
> ToD operations use a wait-before-write pattern to avoid blocking
> after each operation.
> 
> The tod_ready_wait helper selects the poll timeout based on the
> current ToD command - write operations use a longer timeout (1000 ms)
> than reads (30 ms).
> 
> The ToD read captures system timestamps (ptp_system_timestamp) around
> the HW command and completion poll to support cross-timestamping.
> 
> The TIE write operation provides sub-picosecond resolution phase
> adjustment for modes where the DPLL is tracking a reference
> (AUTO and REFLOCK).
> 
> Add output step-time mask to struct zl3073x_dev and
> zl3073x_dev_out_is_stepped() helper to check if an output
> participates in step-time operations.
> 
> Reviewed-by: Petr Oros <poros@redhat.com>
> Tested-by: Chris du Quesnay <Chris.duQuesnay@microchip.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
>   drivers/dpll/zl3073x/chan.c | 321 +++++++++++++++++++++++++++++++++++-
>   drivers/dpll/zl3073x/chan.h |  32 ++++
>   drivers/dpll/zl3073x/core.c |  13 ++
>   drivers/dpll/zl3073x/core.h |  23 +++
>   drivers/dpll/zl3073x/regs.h |  52 ++++++
>   5 files changed, 439 insertions(+), 2 deletions(-)
> 
> ...
> +/**
> + * zl3073x_chan_tod_adjust - atomic ToD read-modify-write with rollover guard
> + * @zldev: pointer to zl3073x device
> + * @ch: DPLL channel index
> + * @delta: time adjustment to apply
> + *
> + * Reads the next-Hz ToD and current ToD, then checks whether enough time
> + * remains before the next 1 Hz rollover to safely complete the write.
> + * Re-reads if the 1 Hz tick crossed between the two reads or if less
> + * than 20 ms remains before the next rollover. Applies @delta and writes
> + * the result back.
> + *
> + * Context: Caller must serialize all zl3073x_chan_tod_* calls externally.
> + * Return: 0 on success, <0 on error
> + */
> +#define ZL_TOD_MAX_RETRIES	20
> +int zl3073x_chan_tod_adjust(struct zl3073x_dev *zldev, u8 ch,
> +			    struct timespec64 delta)
> +{

Oops, wrongly placed macro causing...


/logs/build/1142084/14736686/kdoc/stdout 0 ok |
raw

Warnings before patch:
files: ['drivers/dpll/zl3073x/chan.c', 'drivers/dpll/zl3073x/chan.h', 
'drivers/dpll/zl3073x/core.c', 'drivers/dpll/zl3073x/core.h', 
'drivers/dpll/zl3073x/regs.h']

Current warnings:
files: ['drivers/dpll/zl3073x/chan.c', 'drivers/dpll/zl3073x/chan.h', 
'drivers/dpll/zl3073x/core.c', 'drivers/dpll/zl3073x/core.h', 
'drivers/dpll/zl3073x/regs.h']
Warning: drivers/dpll/zl3073x/chan.c:399 expecting prototype for 
zl3073x_chan_tod_adjust(). Prototype was for ZL_TOD_MAX_RETRIES() instead

Warnings before: 0 after: 1 (add: 1)

New warnings added:
Warning: drivers/dpll/zl3073x/chan.c:399 expecting prototype for 
zl3073x_chan_tod_adjust(). Prototype was for ZL_TOD_MAX_RETRIES() instead
Per-file breakdown:
      1 drivers/dpll/zl3073x/chan.c


Will fix in v6.

Ivan


  reply	other threads:[~2026-08-09 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  9:58 [PATCH net-next v5 0/3] dpll: zl3073x: add PTP clock support Ivan Vecera
2026-08-07  9:58 ` [PATCH net-next v5 1/3] dpll: zl3073x: scale poll interval proportionally to timeout Ivan Vecera
2026-08-07  9:58 ` [PATCH net-next v5 2/3] dpll: zl3073x: add channel ToD, phase step and TIE operations Ivan Vecera
2026-08-09 18:22   ` Ivan Vecera [this message]
2026-08-07  9:58 ` [PATCH net-next v5 3/3] dpll: zl3073x: add PTP clock support 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=667c004b-6181-41c5-bea1-0a66e354bc96@redhat.com \
    --to=ivecera@redhat.com \
    --cc=Chris.duQuesnay@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@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

all inboxes | Powered by JetHome®