From: Jacob Keller <jacob.e.keller@intel.com>
To: <netdev-bot+sashiko@kernel.org>, <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>,
<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: Mon, 30 Nov 2026 15:02:49 -0800 [thread overview]
Message-ID: <786a4396-38ad-4e3d-aeb2-333e22c731c0@intel.com> (raw)
In-Reply-To: <179573400778.3135.2988543819162963844@kernel.org>
On 11/26/2026 3:00 PM, netdev-bot+sashiko@kernel.org wrote:
> 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.
>
This could be slightly clarified. This was found on an early
pre-production stepping of a device, and it was then assumed that it
would be required for all E823 devices. (Hence the original fix claiming
it is required for those devices).
> 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?
>
We tested this across a wide array of E823 silicon steppings.
Since the original "fix", we discovered that this isn't actually
required on E823 production devices as originally believed. The only
device SKUs that actually require this are pre-production and have
deivce IDs which aren't supported by the in-tree driver. In principle,
we could modify the code to acquire the PTP lock to block timer commands
while doing the PTM here. But that is more complex and unnecessary since
the supported hardware doesn't actually require this.
> 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?
>
> [ ... ]
>
next prev parent reply other threads:[~2026-11-30 23:02 UTC|newest]
Thread overview: 15+ 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-12-01 0:32 ` Tony Nguyen
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-30 22:51 ` Tony Nguyen
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
2026-11-30 23:02 ` Jacob Keller [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=786a4396-38ad-4e3d-aeb2-333e22c731c0@intel.com \
--to=jacob.e.keller@intel.com \
--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=kuba@kernel.org \
--cc=maciej.machnikowski@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev-bot+sashiko@kernel.org \
--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