mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: james.hilliard1@gmail.com
Cc: netdev@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org,
	richardcochran@gmail.com, andrew+netdev@lunn.ch,
	yangbo.lu@nxp.com, mlichvar@redhat.com, edumazet@kernel.org,
	davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 5/5] ptp: vclock: preserve missing hardware timestamps
Date: Thu, 15 Oct 2026 22:22:07 +0000	[thread overview]
Message-ID: <179210292756.434549.32365876445256361@kernel.org> (raw)
In-Reply-To: <20261013-ptp-vclock-sampling-v3-5-d3ee4ea62fc6@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The patch adds a new early return to ptp_convert_timestamp() in
  drivers/ptp/ptp_vclock.c: when the input hardware timestamp is zero…

--

ptp: vclock: preserve missing hardware timestamps

Socket timestamp delivery converts hardware timestamps to a vclock time
before it checks whether a hardware timestamp is present. With a zero
input, timecounter_cyc2time() can return a nonzero value. This patch
makes ptp_convert_timestamp() return 0 without converting when the input
timestamp is zero.

> diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
> index 6675466bc3074..4a62047f0ce0f 100644
> --- a/drivers/ptp/ptp_vclock.c
> +++ b/drivers/ptp/ptp_vclock.c
> @@ -307,6 +307,8 @@ ktime_t ptp_convert_timestamp(const ktime_t *hwtstamp, int vclock_index)
>  	u64 ns;
>  
>  	ns = ktime_to_ns(*hwtstamp);
> +	if (!ns)
> +		return 0;

[Severity: Low]

This isn't a bug, but should the kernel-doc for ptp_convert_timestamp()
in include/linux/ptp_clock_kernel.h be updated as well? It still says:

 * Returns: converted timestamp, or 0 on error.

The new early return gives 0 on a path that is not an error. It passes
through the "no hardware timestamp" case. After this patch, a 0 return
means either a failed lookup or conversion, or a zero @hwtstamp.

Both callers in net/socket.c already treat 0 as "no timestamp", so
nothing changes at runtime. A wording such as "converted timestamp, or 0
if @hwtstamp is zero or on error" would match the new behaviour.

>  
>  	srcu_idx = srcu_read_lock(&vclock_srcu);
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261013-ptp-vclock-sampling-v3-0-d3ee4ea62fc6%40gmail.com

      parent reply	other threads:[~2026-10-15 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 19:19 [PATCH net v3 0/5] ptp: make virtual clock sampling and teardown failure-safe James Hilliard
2026-10-13 19:19 ` [PATCH net v3 1/5] ptp: drain virtual clock sysfs operations before unregistering children James Hilliard
2026-10-13 19:46   ` Vadim Fedorenko
2026-10-13 19:19 ` [PATCH net v3 2/5] ptp: unwind partially completed virtual clock creation James Hilliard
2026-10-13 19:19 ` [PATCH net v3 3/5] ptp: vclock: propagate physical clock sampling errors James Hilliard
2026-10-15 22:22   ` netdev-bot+sashiko
2026-10-13 19:19 ` [PATCH net v3 4/5] ptp: vclock: serialize extended samples with counter updates James Hilliard
2026-10-13 19:19 ` [PATCH net v3 5/5] ptp: vclock: preserve missing hardware timestamps James Hilliard
2026-10-13 19:52   ` Vadim Fedorenko
2026-10-15 22:22   ` netdev-bot+sashiko [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=179210292756.434549.32365876445256361@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=yangbo.lu@nxp.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®