On 11/26/2026 3:00 PM, netd…@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?
>
> [ ... ]
>