[PATCH iwl-net v2 08/14] ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset

Nowlin, Alexander alexander.nowlin at intel.com
Tue Sep 8 18:05:31 UTC 2026


> -----Original Message-----
> From: Keller, Jacob E <jacob.e.keller at intel.com> 
> Sent: Tuesday, August 25, 2026 3:54 PM
> To: Intel Wired LAN <intel-wired-lan at lists.osuosl.org>
> Cc: netdev at vger.kernel.org; Machnikowski, Maciej <maciej.machnikowski at intel.com>; Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Korba, Przemyslaw <przemyslaw.korba at intel.com>; Nitka, Grzegorz <grzegorz.nitka at intel.com>; Oros, Petr <poros at redhat.com>; Nowlin, Alexander <alexander.nowlin at intel.com>; Bross, Kevin <kevin.bross at intel.com>; Cavatur, Ranjit <ranjit.cavatur at intel.com>; Keller, Jacob E <jacob.e.keller at intel.com>; Machnikowski, Maciej <maciej.machnikowski at intel.com>
> Subject: [PATCH iwl-net v2 08/14] ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset
> 
> The current implementation of ice_ptp_reset_ts_memory_eth56g() is flawed.
> It tries to clear the timestamp memory by writing to the PHY_REG_TX_MEMORY_STATUS region. This does not work properly, as it does not trigger appropriate PHY actions.
> 
> To clear outstanding timestamp memory, the driver must read the timestamps.
> However, naively doing this as part of ice_ptp_reset_ts_memory() is problematic. When reading the timestamp index, hardware kicks off a chain of actions including clearing the ready bitmap index, and decrementing an internal counter if the timestamp index was marked as valid.
> 
> This can potentially leave the internal hardware counter out of sync with the actual number of timestamps. This occurs because the PHY_REG_TX_MEMORY_STATUS region is not zero-initialized when the device > boots up. Instead, it is filled with garbage. On a cold power on, attempts to read the stale data result in the hardware triggering a counter decrement for a timestamp that never happened. This underflows the counter, and prevents new timestamp interrupts from being triggered for real timestamp requests.
> 
> We must read the PHY_REG_TX_MEMORY_STATUS in order to clear stale timestamps. But doing so may cause a desync with the counter. To prevent issues, perform this clearing always and only right before initiating a PHY soft reset.
> 
> The soft reset will clear and reset the internal counter and the ready bitmap. The reads to PHY_REG_TX_MEMORY_STATUS will reset the region valid bits ensuring that no stale data is left behind. This combination ensures that we always have a clean slate with no stale data and with the counter properly reset to zero.
> 
> Fixes: 3ec46e157c7f ("ice: perform PHY soft reset for E825C ports at initialization")
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> Reviewed-by: Maciek Machnikowski <maciej.machnikowski at intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 88 +++++++++++++++--------------
>  1 file changed, 47 insertions(+), 41 deletions(-)

Tested-by: Alexander Nowlin <alexander.nowlin at intel.com>


More information about the Intel-wired-lan mailing list