Article View: linux.kernel.netdev
Article #7271Re: [PATCH net v5 10/13] ice: E825: perform a soft reset when starting the PHY timer
From: netdev-bot+sashiko
Date: Sun, 25 Oct 2026 23:44
Date: Sun, 25 Oct 2026 23:44
159 lines
14625 bytes
14625 bytes
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
Technical Details
Message-ID:
<179297184384.3134.3372650759308982003@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351635-linux-kernel-netdev=dewy.ruReferences:
<20261021-jk-e825c-timestamp-processing-logic-fixes-srcu-v5-10-72289a4ac8eb@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351635-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179297184384.3134.3372650759308982003@kernel.org> References: <20261021-jk-e825c-timestamp-processing-logic-fixes-srcu-v5-10-72289a4ac8eb@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1173373"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8VdojqfMh6AZnstnL6EDvbZRIww= sha256:uzKPYebW0uRfSsyqtnulLn8AcCNnbzsSuZOiSagwaOY= sha1:UQKRtSnfd9l57gcvEUAMgJYfuAM= sha256:Rf+WdDF/69zXIVArx0ENjEXu+Kn7xi4a7s4URFScMTA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id D380C125B7E; Mon, 26 Oct 2026 02:45:46 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xj7EuzkRUfla; Mon, 26 Oct 2026 02:45:43 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351635-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 1CDF6125B7B; Mon, 26 Oct 2026 02:45:35 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D45E53B559; Sun, 25 Oct 2026 23:44:06 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792971846; b=wPQGwV7c+bchp0bRSLJxDOfvFz6q8d+Gb80qgMvcoRcgss8a2FlYG1dN0HjbtX65BVrk 4+uGeB4WoNmIJN0eYzwOQvPIGRpAqujvHWpjs4vAnQRtPYqO1uxgla0gdw8WCZhr4XF2S h8AU/kWin434ePOp7GuHRoEbdHhOkTMW6su1xUnfxumE4umh03KB/wjQwi6juZfvaojSX lfdsA3DlzYlK/IP1vXWp8o9acyKqa8kZdMuMiTaCx+Fgt6ldG/A22Ov/3YBa9EVfP0BYz efarto34roMO2OqQDh0RdOEAz/hWjglY0OTCCwMvjMagf0z0yAd3Y5d3Ru2i/Xu/iTg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792971846; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=k3N+rDq+/wK9k5QwJlILu6CXlHNYiLo2QB9IXeLNF0Q=; b=P/xY5In5E0xyLYXmjtLLBGWYgBHCRsidqmNzNHdkuUGQb1ytYYYnzhExZ06y4a3BppBo yqYCmjyunTbOoMV+QgW2//Wju6U1SekJYVxf7rRos87C1O6tqsjZdsQ6OmQGe3/BFc7+z YbECuER1YNGsQ8pQiv05adOUNlel7R7XmlqJhPcYeoaT9rw0Bo2DvSPSkJpJC3VbGDl0H 7U/qieFNv3DXTZXCG0vINa8gs/1XcfjOBELhrwiFpy5KPgsXgUmJPiHsolCiRSW/Wv3+E L8ThqcfCBYwQkFF9aTobt19lZvK2W4Q8hSpapLHisGHlxIaGbyIIFJZXnIEUhqvLYJg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkHZ5wrg; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A78DD606A31A; Sun, 25 Oct 2026 23:44:06 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkHZ5wrg X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792971845; b=K3fqyTTrNd877kqUhEEyPwmwZjbe9ebU+DSQM+gVSDXO3JjAAbsu5pcnWgpTE33UHDWu RfY82RYOHAjDMhqy5o98/zwKNWt8SJlOd4CVfRpcXC4SfE9A2rBJC3IMPEjoZoT+zvKHg X1+RUJV2z4kavpEkNkkgJ0gjG55pVTZnrU08r+1nsSMKMa4nvCDNZF/Smz/9nQj//sWAn l9wkTlAD1RLeorHaN5/uXPsIA2hHUSTR75MZsAZFwJlK0wCxct+u3/fQgm6Hfb2n2tm4G gEigE4mbI8MJPgrw2Hauzq5UGvxtKRrX7W1o49eOunShrKcVXzqut5Y0HYGpAUhj4bQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792971845; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=k3N+rDq+/wK9k5QwJlILu6CXlHNYiLo2QB9IXeLNF0Q=; b=EKS6SPV6MLBWo02IC3N/GJeHFrkeTcf0qKfxLMaP1el39iR4o139if677gEnbqz78JEh Qw71voreOPz7DURFb7KFVbEkPDz+SwrBzmh2xNLxkTocqGGz90FYqQP+tLb6j7briZFfS pCIoNYTq3vPtsA03xiE7CfEfjwoTXaLgKqyQ0CwxTY0y5elsiPAO/txaeKKF518SrGJMG 3eXQowX96SYCzVe74LvBKDXPKc0Qo+MLFD1u5NAsQozToyTuDbGE5ALvlg8XA/SaGnyi3 t5JAxx9S0z6gjjCUk+DCLHx1thb9Qc0g4UdcfuSLqmWWQGRUSffZXywgvnEyk7RQevA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kkHZ5wrg; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83B12606A323 for <netdev@vger.kernel.org>; Sun, 25 Oct 2026 23:44:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DCF61F01828; Sun, 25 Oct 2026 23:44:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792971845; bh=k3N+rDq+/wK9k5QwJlILu6CXlHNYiLo2QB9IXeLNF0Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=kkHZ5wrgPZqXaHzLig/R6Ffs7Wo/+6rr2Q5TjTxDOCu+gFrGinhXc3ISXbS0gLSvQ 4g2knxP57OZbdu5n7Y4+YB3qVnh22zvULkI6Z3sbOE6mFxmKBBY4DlPXa5fqkN9DjL sXbhMg1lKOu/yjEjBn2ipIe8LBo2KK+C/vUcHjP9IONWHXyiHSa/k6HM+De88VBzQj 15i89W1TPcgFD+7+BMSCNHFzEGzxCtWueEaKBQu88pF1Km6VT31cnZqAVCMzKAbFfR lOyoOikodeJw9mpTDTapruc1rkvBm+QARienk0+rtddQiEyH/4ZF2dsdBGmRa3r4G2 tpVgFe8z2rmTQ== X-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 X-In-Reply-To: <20261021-jk-e825c-timestamp-processing-logic-fixes-srcu-v5-10-72289a4ac8eb@intel.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list