From: netdev-bot+sashiko@kernel.org
To: jacob.e.keller@intel.com
Cc: przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, poros@redhat.com, netdev@vger.kernel.org,
grzegorz.nitka@intel.com, aleksandr.loktionov@intel.com,
alexander.nowlin@intel.com, anthony.l.nguyen@intel.com,
maciej.machnikowski@intel.com, przemyslaw.korba@intel.com,
sergey.temerkhanov@intel.com, arkadiusz.kubalewski@intel.com,
richardcochran@gmail.com, horms@kernel.org
Subject: Re: [PATCH net v5 10/13] ice: E825: perform a soft reset when starting the PHY timer
Date: Sun, 25 Oct 2026 23:44:03 +0000 [thread overview]
Message-ID: <179297184384.3134.3372650759308982003@kernel.org> (raw)
In-Reply-To: <20261021-jk-e825c-timestamp-processing-logic-fixes-srcu-v5-10-72289a4ac8eb@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · 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] ice_start_phy_timer_eth56g()
(drivers/net/ethernet/intel/ice/ice_ptp_hw.c) now calls…
- [Medium] With this patch, the destructive E825 PHY soft-reset sequence
runs at runtime from ice_start_phy_timer_eth56g(), mainly on E825…
--
ice: E825: perform a soft reset when starting the PHY timer
This patch makes ice_start_phy_timer_eth56g() call
ice_ptp_phy_soft_reset_eth56g() before it programs the E825 PHY. The goal
is to clear any outstanding Tx timestamp memory and the PHY timestamp
counter. Only the timer block of the PHY is reset.
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> index 5637925c0e68..2d000251b185 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
[ ... ]
> @@ -2150,6 +2152,10 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
> if (err)
> return err;
>
> + err = ice_ptp_phy_soft_reset_eth56g(hw, port);
> + if (err)
> + return err;
> +
[Severity: Medium]
Should the software Tx timestamp tracker be flushed before this reset
wipes the hardware timestamp memory?
On E825 link-up the path is ice_ptp_link_change() ->
ice_ptp_port_phy_restart() -> ice_start_phy_timer_eth56g(). The E825 case
in ice_ptp_port_phy_restart() only marks the outstanding entries stale:
drivers/net/ethernet/intel/ice/ice_ptp.c:ice_ptp_port_phy_restart() {
...
ptp_port->tx.disabled = true;
spin_unlock_irqrestore(&ptp_port->tx.lock, flags);
ice_ptp_mark_tx_tracker_stale(&ptp_port->tx);
err = ice_start_phy_timer_eth56g(hw, port);
...
}
The in_use bits and tstamps[idx].skb stay in place. After that,
ice_ptp_phy_soft_reset_eth56g() calls
ice_ptp_clear_tx_memory_status_eth56g() and pulses the soft reset, which
clears every ready bit on the port.
Take an entry whose timestamp was captured but not read yet. Before this
patch it would have been read through the ready bit path and quietly
dropped as stale. Now its ready bit never comes back, so
ice_ptp_process_tx_tstamp() can only release it through the timeout:
if (time_is_before_jiffies(tx->tstamps[idx].start + 2 * HZ)) {
drop_ts = true;
/* Count the number of Tx timestamps that timed out */
pf->ptp.tx_hwtstamp_timeouts++;
}
Does this hold the slot and the skb from ice_ptp_request_ts() for about
2 seconds? Does it also count a timestamp the driver threw away itself in
tx_hwtstamp_timeouts, which ethtool -S reports?
At this commit there is also no time bound on the hold. The periodic
fallback in ice_ptp_maybe_trigger_tx_interrupt() fires only when the
hardware ready bits are set, and the reset has just cleared them.
The later commit "ice: keep Tx timestamp slots tracked until completion
or timeout" changes that trigger to check the software in_use bitmap.
That bounds the reclaim to about 2.5 seconds. The miscounted timeouts and
the temporary slot and skb hold are still there at the end of the series.
ice_ptp_rebuild_owner() already flushes the software state before it
restarts the PHYs:
/* Flush software tracking of any outstanding timestamps since we're
* about to flush the PHY timestamp block.
*/
ice_ptp_flush_all_tx_tracker(pf);
Would the link change restart path need a matching flush? The commit
message says only that the reset will "clear any outstanding Tx timestamp
memory". It doesn't mention what happens to the software tracker.
[Severity: Medium]
What keeps the Tx timestamp interrupt thread and in-flight hardware
captures away from this port while the soft reset sequence runs?
Before this patch, the only caller of ice_ptp_phy_soft_reset_eth56g() was
ice_ptp_init_phc_e825c(), at PHC init. Now it also runs on every E825
link-up restart. The sequence sweeps all slots and sleeps before the
reset is asserted:
drivers/net/ethernet/intel/ice/ice_ptp_hw.c:ice_ptp_phy_soft_reset_eth56g() {
ice_ptp_clear_tx_memory_status_eth56g(hw, port);
...
usleep_range(5000, 6000);
global_val |= PHY_REG_GLOBAL_SOFT_RESET_M;
...
usleep_range(5000, 6000);
...
}
ice_stop_phy_timer_eth56g() leaves PHY_REG_TX_OFFSET_READY set, so the
PHY keeps capturing timestamps for descriptors that were posted before
tx.disabled was set. A capture can land on an index the sweep has already
passed, during the 5 ms gap before the reset is asserted.
The consumer path is ice_misc_intr_thread_fn() -> ice_ptp_process_ts() ->
ice_ptp_tx_tstamp_owner() -> ice_ptp_process_tx_tstamp(). It never takes
ps_lock. Its ice_is_reset_in_progress() check doesn't cover a link
triggered PHY restart. It snapshots the ready bitmap and then calls
ice_read_phy_tstamp() based on that snapshot.
Suppose the thread snapshots that new ready bit and then reads the slot
after the soft reset. It would read a slot whose valid bit is still set,
against a counter that was just reset to zero. The kdoc for
ice_ptp_clear_tx_memory_status_eth56g() says the soft reset does not clear
the timestamp memory.
The earlier commit "ice: E825: clear PHY_TSTAMP memory prior to soft
reset" says an unbalanced read "underflows the counter, and prevents new
timestamp interrupts from being triggered".
Could this stall Tx timestamp interrupts on the port until the next soft
reset? That is the failure this patch is meant to prevent. Whether it
happens depends on PHY behavior described only in this series and on a
narrow timing window. Even so, nothing in the code seems to prevent the
interleaving.
Does this path need to synchronize with the misc IRQ thread, or wait for
in-flight captures, before it runs the sweep and the reset?
> ice_ptp_src_cmd(hw, ICE_PTP_NOP);
>
> err = ice_phy_cfg_parpcs_eth56g(hw, port);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261021-jk-e825c-timestamp-processing-logic-fixes-srcu-v5-0-72289a4ac8eb%40intel.com
next prev reply other threads:[~2026-10-25 23:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 22:12 [PATCH net v5 00/13] ice: E82x: timestamp processing logic fixes Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 01/13] ice: fix removal of PTP timestamp tracker during reset Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:23 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 02/13] ice: use reference counting and SRCU for PTP port access Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 03/13] ice: fix PHY port restart serialization Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:30 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 04/13] ice: set in_use only after preparing Tx timestamp index Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 05/13] ice: call PTP link change only from link events Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:40 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 06/13] ice: E822: keep Tx timestamps disabled during offset calibration Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 07/13] ice: E822: cancel offset verification work during reset preparation Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:41 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 08/13] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:41 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 09/13] ice: E825: clear PHY_TSTAMP memory prior to soft reset Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:43 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 10/13] ice: E825: perform a soft reset when starting the PHY timer Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko [this message]
2026-10-26 21:52 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 11/13] ice: keep Tx timestamp slots tracked until completion or timeout Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:58 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 12/13] ice: skip reading Tx ready bitmap on ports with no timestamps Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 13/13] ice: don't clear in_use until HW clears ready bitmap Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 22:07 ` Jacob Keller
2026-10-27 14:40 ` [PATCH net v5 00/13] ice: E82x: timestamp processing logic fixes Paolo Abeni
2026-10-27 19:32 ` Jacob Keller
2026-10-27 22:15 ` Jakub Kicinski
2026-10-27 22:57 ` Jacob Keller
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=179297184384.3134.3372650759308982003@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=alexander.nowlin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@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=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=przemyslaw.korba@intel.com \
--cc=richardcochran@gmail.com \
--cc=sergey.temerkhanov@intel.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