πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5126

Re: [PATCH net v3 08/14] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY

#5126
From: netdev-bot+sashiko
Date: Mon, 19 Oct 2026 20:14
143 lines
13127 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The kernel-doc no longer matches how the code uses `struct
  ice_ptp_tx::calibrating` and `ice_ptp_mark_tx_tracker_stale()`.
- [Low] The new dev_err in `ice_ptp_port_phy_restart()`
  (ice_ptp.c:1347-1349) says "Timestamping remains disabled", which is…

--

ice: E825: stop clearing PHY_REG_TX_OFFSET_READY

On E825, ice_stop_phy_timer_eth56g() no longer clears
PHY_REG_TX_OFFSET_READY, because clearing it puts the hardware Tx timestamp
counter out of sync. Instead, the PHY stop and restart paths set
tx.calibrating to block new Tx timestamp requests, and mark outstanding
timestamps stale. The unused soft_reset parameter is removed and the
restart failure message is reworded.

> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 6297773806949..365cff9c10173 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -818,7 +818,8 @@ ice_ptp_mark_tx_tracker_stale(struct ice_ptp_tx *tx)
>  	unsigned long flags;
>  
>  	spin_lock_irqsave(&tx->lock, flags);
> -	bitmap_or(tx->stale, tx->stale, tx->in_use, tx->len);
> +	if (tx->init)
> +		bitmap_or(tx->stale, tx->stale, tx->in_use, tx->len);
>  	spin_unlock_irqrestore(&tx->lock, flags);
>  }
>  

[ ... ]

> @@ -1243,7 +1245,14 @@ ice_ptp_port_phy_stop(struct ice_ptp_port *ptp_port)
>  		err = ice_stop_phy_timer_e82x(hw, port, true);
>  		break;
>  	case ICE_MAC_GENERIC_3K_E825:
> -		err = ice_stop_phy_timer_eth56g(hw, port, true);
> +		/* Disable new Tx timestamp requests */
> +		spin_lock_irqsave(&ptp_port->tx.lock, flags);
> +		ptp_port->tx.calibrating = true;
> +		spin_unlock_irqrestore(&ptp_port->tx.lock, flags);
> +
> +		ice_ptp_mark_tx_tracker_stale(&ptp_port->tx);

[Severity: Low]
This isn't a bug, but should the kernel-doc for the calibrating field be
updated to match how E825 now uses it? In ice_ptp.h, struct ice_ptp_tx
still says:

 * @calibrating: if true, the PHY is calibrating the Tx offset. During this
 *               window, timestamp requests are disabled.

After this patch, E825 sets the bit in ice_ptp_port_phy_stop() on link
down, where no calibration runs. The commit message also says E825 "does
not perform vernier calibration".

ice_ptp_port_phy_restart() leaves the bit set on failure, so it acts as a
"timestamping disabled until link toggle" state. ice_ptp_release() also
leaves the bit set after teardown.

The kernel-doc for ice_ptp_mark_tx_tracker_stale() has the same problem. It
still says:

 * This should be called when the PTP clock is modified such as after a set
 * time request.

It doesn't mention the new PHY stop and restart callers. It also doesn't say
that the helper now does nothing when tx->init is clear. The teardown order
in ice_ptp_release() depends on that check, because the tracker bitmaps have
already been freed:

ice_ptp_release()
    ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx);
    ...
    ice_ptp_port_phy_stop(&pf->ptp.port);
        ice_ptp_mark_tx_tracker_stale(&ptp_port->tx);

Could both comments be updated to describe the new behavior?

> +
> +		err = ice_stop_phy_timer_eth56g(hw, port);
>  		break;

[ ... ]

> @@ -1309,15 +1318,35 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)

[ ... ]

>  		err = ice_start_phy_timer_eth56g(hw, port);
> +		if (err)
> +			break;
> +
> +		spin_lock_irqsave(&ptp_port->tx.lock, flags);
> +		ptp_port->tx.calibrating = false;
> +		spin_unlock_irqrestore(&ptp_port->tx.lock, flags);
> +
>  		break;
>  	default:

[ ... ]

>  	if (err)
> -		dev_err(ice_pf_to_dev(pf), "PTP failed to set PHY port %d up, err %d\n",
> -			port, err);
> +		dev_err(ice_pf_to_dev(pf), "PTP failed to restart PHY port %u with err %pe; Timestamping remains disabled; A link-toggle may recover.\n",
> +			port, ERR_PTR(err));

[Severity: Low]
Is "Timestamping remains disabled" accurate for Rx on E825 in every
failure case?

Tx is now blocked only in software, through tx.calibrating. Rx is blocked
only in hardware, through PHY_REG_RX_OFFSET_READY.

Suppose the first register write in ice_start_phy_timer_eth56g() fails:

ice_start_phy_timer_eth56g()
    err = ice_stop_phy_timer_eth56g(hw, port);
    if (err)
        return err;

PHY_REG_RX_OFFSET_READY then keeps its previous value, for example 1 from
an earlier successful start. The hardware may keep marking Rx descriptor
timestamps valid, even though ice_sync_phy_timer_eth56g() never ran.

If any later step fails, RX_OFFSET_READY has already been cleared and the
message is accurate. The early return is not new; only the message's
absolute claim is.

Could the message be more precise here, for example by saying that Tx
timestamping remains disabled?

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261015191102.1174111-1-anthony.l.nguyen%40intel.com
Technical Details
Message-ID: <179244085024.3135.15051854897545383662@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-348826-linux-kernel-netdev=dewy.ru
References: <20261015191102.1174111-9-anthony.l.nguyen@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-348826-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 08/14] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY
Date: Mon, 19 Oct 2026 20:14:10 +0000
Organization: Usenet Network
Message-ID: <179244085024.3135.15051854897545383662@kernel.org>
References: <20261015191102.1174111-9-anthony.l.nguyen@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3705912"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bIfjj2nx3oTf1hEJNJTtFZU4Bas= sha256:8ayCeXbAwrLaWYBII194uPeKRsQxxtx8VM/uw7geQEU=
	sha1:NZmmtzaHfLhkYbijCLZj7wBYLSE= sha256:awbkGOmYAJevpSiMuSR0maPmtAmKOx+boWPYRaMv7fo=
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 B4BA2110B1D; Mon, 19 Oct 2026 23:20:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.729
X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 TJv3O1Em_eY1;
	Mon, 19 Oct 2026 23:20:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-348826-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 5D88E110B1A; Mon, 19 Oct 2026 23:20:05 +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 D916360752; Mon, 19 Oct 2026 20:14:26 +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=1792440858;
	b=R6Ub3XnsGroXLy2x0Teb1AaqaeDrADHf1m5XFkzOFJdWIeZfhyD506u09Lh6xpzz+qDE
	 8+Xl0kXKE5nLlGj4PUDMd785tBEu/InOuqAbcCQviH2yw1M4utizrA8syGo+p4jRJGmum
	 q+srkA+LZ6GZtj1XwEyo5vdm+Zr4hpj4AB152p/UN5bpTRHAVekT8jmc8RLMKt2Rm7WMt
	 KVFLm04a8QWfeCxC+PobnYHoaoFn4BSnqXm+8DKck0d6tt8KQDSldNliIVeCzXeqIke8U
	 Pv1db5GIAYpdzznFswIaVKSP4DZ5LEpB5/ztw+0YdI9lGF1P6EP96hYN0J2hx5Uo0sA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792440858;
	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=DzrcsOeLD3pI6O2YFZ/rfcIsT7DsrqTOKWvM27ebr0M=;
	b=NrYnZcsUXbHAsKU2aIZ92br/2fSDG8IAGh1nEpIs2fnfSPXqd0mEq6/g1wLwxuaeo/pp
	 G/PfAhTownhmmf/3nfZz/00OJAmYdohYGI1xUZ8/p8srJtVBiRXpS2YvObwoZyGtdH3St
	 ZIqx4iyyD4ILI9Pd6pgKPXX4+WOZOklD4/rBF5Sne8OBGQcJqoKV70RP39igSlHWzvgI9
	 ur9bPrww6Y9QHrJDLnbknJkFb78tPfPo55SG4Dd1y7Hku0Vu/DXTZEfG7U+dZ2Ee3rsK7
	 BxtZ4d52PwD68+zNW0T8yggGLJI7IrU3j9UiX+DTyAeFbvL9QXdgm114ikZZTAG60Mg==
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=kHbbebwO;
	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 0DD5F606A32F;
	Mon, 19 Oct 2026 20:14:18 +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=kHbbebwO
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=1792440852;
	b=b9BpvjXBD31/F73s3QBqGaile0UV+QYukvL2U/ZOQmARogzlvt7ho+pxGR7DUSUGMQL5
	 3pBFgSe2RXoO+XhZQPkVQ1GrX3yZmqJd3tZTUX9fGRPzFwSGEbGRvg22Kw5jJ5JdYWDEb
	 Q9IxDYZwwaj5O9+PTGB//pD8QolzHdaRDwahLzrYckhDOS0UPfpGAAUBzPXb2BevywR5H
	 DFyIt24Hng29NqDwFD7gQDsg1llbfSm/AvE0lS3fPYILiYi1sovmTvqnO31zMFH4zVfJK
	 c2gVn8A2EaVQCwn9+X1aWKMqP4qq3tVZ7IeRkiBeG7dBxeNnQgZSb9ki5fd0/E2Zi4A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792440852;
	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=DzrcsOeLD3pI6O2YFZ/rfcIsT7DsrqTOKWvM27ebr0M=;
	b=Sl/iI6KpNZyQGE7BtjUsf5gT2gS6H4SvWDo4FtQQpgsiK/SsjNGV40jNvtwLmMDIEXoe
	 b12PLIi5eD0x1xtSThMHQQpUYfVtTxmsdqSccEhwjs+LTXEzyznu8wsWMoKeXFeBtChJI
	 Rb3YAxRvMnr4xy2TGGbgu/UrpvR4hs0lmgVLtfFuIDQ087DU8bTDhwBKHcRnRDPgi8xfF
	 WlY367V1dDhryGfViaQFmjQ+KiAAFp72ao4q1TvKfSsmzwc1XGFgYHjVCIadbXH3PrsUC
	 4W46EvFNBDa0smu5hkznAbwbI9FWScTcRNStkv/uiuhi0JmyBEDpBZqlOTePHBlPwHQ==
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=kHbbebwO;
	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 E19E7606A31F
	for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 20:14:11 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF9AD1F000C6;
	Mon, 19 Oct 2026 20:14:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792440851;
	bh=DzrcsOeLD3pI6O2YFZ/rfcIsT7DsrqTOKWvM27ebr0M=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=kHbbebwO1QWJFdD9xbP3TX28fc4RYGo2ZrcMmdCi6vjK63+HOhg+qguUZuvoEX6zx
	 DLFRL9qAjO/zxZyGb8aabzqCgMsjk8P0fngtzdHcXlNLaUaCu0DFYEvOqb1zOis49N
	 7aVJ9FQJQaIRKPAxSO+56YqoO48RiBnYjZtvQ+1wcAwbVfRs008xC10+3bs/eQLEGq
	 GYpMz+9AizIeImnDk7iSD7Fwx/HoQNH7Jw+4NDay3bVV3jswtZoL7QUic1xvmDZ1gz
	 7ZF7FxNdO+fm6tVRk/y1d2DuiOZo7qaQ8m339/6Z0b8PlgcjLYuDCCW8mGdoOeBboh
	 /E6A/w7qkJdag==
X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, andrew+netdev@lunn.ch, netdev@vger.kernel.org,
 poros@redhat.com, jacob.e.keller@intel.com, maciej.machnikowski@intel.com,
 przemyslaw.korba@intel.com, grzegorz.nitka@intel.com,
 sergey.temerkhanov@intel.com, arkadiusz.kubalewski@intel.com,
 richardcochran@gmail.com, horms@kernel.org
X-In-Reply-To: <20261015191102.1174111-9-anthony.l.nguyen@intel.com>
X-sashiko-severity: Low
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