๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14107

Re: [PATCH net-next 01/10] ice: dpll: notify TSPLL lock status from the periodic work only

#14107
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 17:53
92 lines
11650 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] This patch leaves the comments in
  ice_dpll_tspll_state_on_dpll_set()โ€ฆ

--

ice: dpll: notify TSPLL lock status from the periodic work only

This patch stops ice_dpll_tspll_state_on_dpll_set() from sending a TSPLL
device change notification from the TIME_REF pin callback. The callback
now only updates dpll_state. ice_dpll_periodic_work_e825() refreshes
dpll_state on every run and sends the notification when the state differs
from prev_dpll_state.

> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
> index ade1fb3dd0674..bdbcf7af296eb 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dpll.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c

[ ... ]

> @@ -2947,15 +2946,12 @@ ice_dpll_tspll_state_on_dpll_set(const struct dpll_pin *pin, void *pin_priv,
>  		WRITE_ONCE(pf->ptp.tspll_locked,
>  			   new_state == DPLL_LOCK_STATUS_LOCKED);
>  
> -		if (tp->prev_dpll_state != new_state) {
> -			tp->dpll_state = new_state;
> -			tp->prev_dpll_state = new_state;
> -			changed = true;
> -		}
> +		/* ice_dpll_periodic_work_e825() compares the state with
> +		 * prev_dpll_state and sends the notification.
> +		 */
> +		tp->dpll_state = new_state;

[Severity: Low]
This isn't a bug, but do the comments in ice_dpll_tspll_state_on_dpll_set()
still match how the notification path works after this change?

The new comment reads as if the periodic work compares the tp->dpll_state
written here. In ice_dpll_periodic_work_e825() that value is never read.
The work recomputes the state from the cache and overwrites dpll_state
before it compares:

ice_dpll_periodic_work_e825() {
	...
	new_state = ice_dpll_tspll_lock_status_get(pf, true);

	tp->dpll_state = new_state;
	if (tp->prev_dpll_state != new_state) {
	...
}

The older comment just above the WRITE_ONCE() was not changed:

	/* Sync the cached lock state to what we just observed from HW
	 * so ice_dpll_periodic_work_e825() (cached path) does not emit
	 * a spurious UNLOCKED notification between now and the next
	 * PTP monitor tick.
	 */

That reason applied when the callback also set prev_dpll_state. Now that
it doesn't, the WRITE_ONCE() to pf->ptp.tspll_locked is the only way the
callback's HW reading gets to the periodic work.

Without it, take a switch from TCXO (prev_dpll_state is UNLOCKED) to
TIME_REF where the HW reports LOCKED but the cache still holds false. The
next periodic run would compute UNLOCKED, which matches prev_dpll_state.
No notification would be sent, and dpll_state would go back to UNLOCKED.
The result would be a lost notification, not a spurious one.

Could both comments say that the periodic work picks up the new state
through pf->ptp.tspll_locked? Then a later change is less likely to drop
the WRITE_ONCE() as just a way to avoid spurious notifications. As far as
I can tell, the comments are still unchanged at the end of the series,
after "ice: dpll: update locking comments".

>  	}
>  	mutex_unlock(&pf->dplls.lock);
> -	if (changed)
> -		__dpll_device_change_ntf(tp->dpll);

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261106121005.1327603-1-ivecera%40redhat.com
Technical Details
Message-ID: <179433319925.994134.5092477928749468374@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360490-linux-kernel-netdev=dewy.ru
References: <20261106121005.1327603-2-ivecera@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360490-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 01/10] ice: dpll: notify TSPLL lock status from
 the periodic work only
Date: Tue, 10 Nov 2026 17:53:19 +0000
Organization: Usenet Network
Message-ID: <179433319925.994134.5092477928749468374@kernel.org>
References: <20261106121005.1327603-2-ivecera@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="672510"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:u2+W4vCDJzqpen67ksdyKlWGhEw= sha256:hYeFJhglFUaEWAgYUtwNhTCAuNV7YULipSyMbUna9E8=
	sha1:eiHp7p66FydNq0ynNDq1MSFXH50= sha256:bpRTwt23xiyfEVNQwqZHxhj9oEo0dLVXJ7SJsph6Tlk=
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 38AAA113CBA; Tue, 10 Nov 2026 21:34:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 WnN0_qrdS6im;
	Tue, 10 Nov 2026 21:34:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-360490-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 69E13113CA9; Tue, 10 Nov 2026 21:34:10 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 9F6C6187776; Tue, 10 Nov 2026 17:54:17 +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=1794333212;
	b=uCuXNN1kYHDgnp14esBeZYMjhl5Z3UHMvOddkmfJr1tNbFrpH91PtX7qB3cfzeoQUeVY
	 A/tWMEtxbnMQJ40Q41UBmMC2Q62rTTiQG0Xiw5UFHHxlNOyVhSNLNPtOFaoGwrN3VHO1p
	 at4ha2O0P4fZViUAjx6hqCcPXZzn0vnPv8Xbxy2RVE6+JYFXeNB41j17UfVME41eH/EmM
	 mcOmTo1P3S5XZG/JlTLlLKg0cbGT6TBBhikzMYdhMDhVq4nre7z2aRNaLKNr+OGdsYn6N
	 p1SH24SiwolvCJxsmJOdZPefQL3XYztp1cV9yk0Skwf+3DgydPmWZ3ibxK9vPlA1TuA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794333212;
	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=6MQvK9HWwZWHwV5/ACER8rs2MpoHm1YL0h+P0A0LB84=;
	b=s6XkHDD+2xyRjVYcdOZ1EyjXJUHayEjejdXkx9ysMfB4yJMHSWlf7hCDNZ99CjQVWIof
	 6kq/OiZm7zKp0ohjs4yKdicYeT5AnGAV0i8CE8Oxtof6ubHaU9kVmRY4urkbXfIeTgt2K
	 KiczgsVF/tzfFtzBKZIXe7MKBukGgX9D5Y59omuOwkWZ7UfzPWVZ9Oyp/JRR8yfsBv15z
	 gM4sAVyv9m7YsPxHCVJ3uxI3zKqp/WRf6smubxoIQ4gARv/mYuIjJsHCQov9d9gkupeYN
	 A4ncdfw3ttHsN1ZXYziEGuAhi7TjQWFnIMMfwa6W1Sa0u3/QC+bdw6tZeixi8DlEZew==
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=ouneHihr;
	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 AFE2C60A3835;
	Tue, 10 Nov 2026 17:53:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ouneHihr
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=1794333201;
	b=hEbySvD2DmtSFCRLPqCqd5x4tKNt3MTsIEPaS0GiYytqDwn+s/JCouLu3fPDdrxrjub/
	 nzEGb8ksT/kJ2c4GwuBQUI3iFJiE50feCfTZlAzKq5BlUQhhwvmyxTWrjvWtWGr+o6Zhp
	 vMOsELKxlKtVTr4dI2joTSk/afYlqTwvUyOlHPQW3MHRVG/D3TWOIYqgyJATKRwryOvCV
	 u6ltNwEGUkrHG3lJFuloCqkn9W5+YdiIQKLQBquTv63eOigtvLNC5q2pIPgpPTlb5tcsP
	 Gymkzt9KhoNHJn7rngLnzstHFshsdzeZq7ejZDRwRb87JA9dUbUf3stuwmyo1+yQahw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794333201;
	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=6MQvK9HWwZWHwV5/ACER8rs2MpoHm1YL0h+P0A0LB84=;
	b=qCZOFLpwkInAH1bfMxk/AzTltScWO/XdFdsecjnS1SPv6fLMRJC02241R+3advoxAt6H
	 kPH907rIL0IbrhZ7+JUBmYiNcIrpmwU3ReGih4N3Tem+mN0/Rb8dJ4MVVje1VOB27TLqS
	 0LaCPTw5zaOccYnHcJI3S21NEXYzKaSNmMuMTzI8+VV67PfBo8iqPr8TkOSyhrIcyFfu/
	 ttrtyLRLvWw/DHAkc7BPa1f8NUXA4F957Qo8+oVqYONHwV8vOayJPUnOF2cmm+z+Oj1Xu
	 Ugn5Myzh/F9P0s2C7xY/UGSTL7UfLhjHi3eGMs3x4nSefVxlea6qVZ+jhUz3UiBFoOw==
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=ouneHihr;
	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 484EC606A31C;
	Tue, 10 Nov 2026 17:53:21 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A48D01F0089F;
	Tue, 10 Nov 2026 17:53:19 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794333200;
	bh=6MQvK9HWwZWHwV5/ACER8rs2MpoHm1YL0h+P0A0LB84=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ouneHihrCG3paXR7Ptpn3Lx6Wvz8tQZc3rajD77OTxzog01M9G8DIlQrR0PlosCoK
	 dK7EBIK42+YA1f/e9BxrblvrbCvGoa7/BHbl32Be1QFK9DLFB+cLuOIB/T9Bwj66Yd
	 1jg+ed88eWOWGndCVkkrvrooV7/ZxiIDWdJ/28F+JOwP9Xt0kPepnEIRLcOLFOhZTS
	 PrduKLSb4RsLMNFFA9s8Q75OapieXdiIOuHMkBgFi98g5v+weyVxMMZ6fBTNA1GTq1
	 poTl/zVfvu98L5iPdhMnbbpzsxHW9t04hSJGoiqbIIWUltS02JrcGDGByzpoEY/kN3
	 RQIMYYmU0wQoQ==
X-Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
 arkadiusz.kubalewski@intel.com, jiri@resnulli.us, corbet@lwn.net,
 skhan@linuxfoundation.org, rdunlap@infradead.org, min.li@microchip.com,
 anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
 linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
 intel-wired-lan@lists.osuosl.org, grzegorz.nitka@intel.com,
 karol.kolacinski@intel.com, saeedm@nvidia.com, tariqt@nvidia.com,
 poros@redhat.com
X-In-Reply-To: <20261106121005.1327603-2-ivecera@redhat.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