Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@kernel.org, andrew+netdev@lunn.ch, willemb@google.com,
	netdev@vger.kernel.org, grzegorz.nitka@intel.com,
	przemyslaw.kitszel@intel.com, aaron.ma@canonical.com,
	maciej.machnikowski@intel.com, jacob.e.keller@intel.com,
	richardcochran@gmail.com, sergey.temerkhanov@intel.com,
	milena.olech@intel.com, horms@kernel.org,
	aleksandr.loktionov@intel.com, ayush1x.singh@intel.com
Subject: Re: [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command
Date: Thu, 26 Nov 2026 23:00:07 +0000	[thread overview]
Message-ID: <179573400778.3135.2988543819162963844@kernel.org> (raw)
In-Reply-To: <20261125224428.4126195-5-anthony.l.nguyen@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · 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] In ice_capture_crosststamp()
  (drivers/net/ethernet/intel/ice/ice_ptp.c), the patch drops the…

--

ice: remove redundant cross-timestamp PTP command

This patch changes ice_capture_crosststamp(). It no longer programs
GLTSYN_CMD with READ_TIME before the ART/device cross-timestamp capture,
and no longer clears it with NOP afterwards. The commit message says the
hardware never needed the READ_TIME step, and that writing the shared
GLTSYN_CMD register only adds a potential race.

> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 8908b4f3db353..db1d0e42ae52c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -2183,9 +2183,6 @@ static int ice_capture_crosststamp(ktime_t *device,
>  	/* Snapshot system time for historic interpolation */
>  	ktime_get_snapshot_id(ctx->snapshot_clock_id, &ctx->snapshot);
>  
> -	/* Program cmd to master timer */
> -	ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
> -

[Severity: Medium]
The commit being fixed describes this step as a requirement seen on
hardware, not as an assumption. 88c360e49f51 ("ice: Support
cross-timestamping for E823 devices") says:

    The GLTSYN_CMD register must be programmed with the READ_TIME
    command. Otherwise, the cross timestamp will always report a value of
    zero for the PTP hardware clock time.

This commit message only says:

    It was assumed that this change was needed for E823 devices, which
    turned out to be not true.

Is there a datasheet, erratum or firmware/NVM detail that explains why the
earlier observation was wrong? Was testing done across all E823 silicon
steppings and NVM versions?

If the requirement still holds on some E823 configuration, the capture
would still look successful, because ctl_active clears. The zero PHC time
would then be returned without any check:

	ts_lo = rd32(hw, cfg->dev_time_l[tmr_idx]);
	ts_hi = rd32(hw, cfg->dev_time_h[tmr_idx]);
	ts = ((u64)ts_hi << 32) | ts_lo;
	*device = ns_to_ktime(ts);

ice_ptp_getcrosststamp() selects this routine for ICE_MAC_GENERIC,
ICE_MAC_GENERIC_3K_E825 and ICE_MAC_E830, so every device that supports
cross-timestamping goes through this path. phc2sys uses
PTP_SYS_OFFSET_PRECISE by default when it is available. A PHC time of 0
would show up there as a very large offset and could make it step the
clock.

Separately, this patch carries a Fixes: tag and will probably go to
stable. Could the commit message describe the user-visible symptom of the
old code? Right now it only calls it "a potential race source".

The race looks real. ice_capture_crosststamp() holds only the
cross-timestamp semaphore (PFHH_SEM / E830_PFPTM_SEM). It does not hold
the PTP semaphore that ice_ptp_lock() takes in the settime, adjtime and
incval paths, which also program GLTSYN_CMD.

So the old READ_TIME/NOP writes could overwrite a prepared INIT_TIME,
ADJ_TIME or INIT_INCVAL command, and a clock adjustment would be lost
without any error. Could that be stated in the commit message for
backporters?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125224428.4126195-2-anthony.l.nguyen%40intel.com

  reply	other threads:[~2026-11-26 23:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 22:44 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2026-11-25 (ice) Tony Nguyen
2026-11-25 22:44 ` [PATCH net 1/5] ice: restore DDP state during PFR recovery Tony Nguyen
2026-11-25 22:48   ` netdev-bot+sinfo
2026-11-26 23:00   ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 2/5] ice: clear Flow Director entries before reset cleanup Tony Nguyen
2026-11-26 23:00   ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 3/5] ice: ptp: serialize E825 PHY timer start with PTP lock and incval Tony Nguyen
2026-11-26  0:03   ` Jacob Keller
2026-11-26 23:00   ` netdev-bot+sashiko
2026-11-25 22:44 ` [PATCH net 4/5] ice: remove redundant cross-timestamp PTP command Tony Nguyen
2026-11-26 23:00   ` netdev-bot+sashiko [this message]
2026-11-25 22:44 ` [PATCH net 5/5] ice: fix computation of ETF timestamps for E830 Tony Nguyen

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=179573400778.3135.2988543819162963844@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aaron.ma@canonical.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ayush1x.singh@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=grzegorz.nitka@intel.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=maciej.machnikowski@intel.com \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=sergey.temerkhanov@intel.com \
    --cc=willemb@google.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