🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27075

Re: [PATCH net-next 2/3] dpll: zl3073x: always fetch device state on start

#27075
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 18:55
155 lines
13758 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

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] Regression: a devlink DRIVER_REINIT reload now throws away the
  cached NCO frequency offset (chan->df_offset) of any DPLL channel the…
- [Low] The commit message admits an existing defect ('The device CPU
  reset at the end of a flash update already allows the same.') and this…

--

dpll: zl3073x: always fetch device state on start

This commit removes the 'full' parameter from zl3073x_dev_start(). The
function now always fetches the device state and sets up the phase offset
measurement block. The devlink DRIVER_REINIT reload, which used to skip
both steps, now goes through them as well.

> The devlink FW_ACTIVATE reload, added later in this series, resets the
> device, which reloads the whole configuration from flash. If the
> restart after the reset fails, a following DRIVER_REINIT reload would
> register the DPLLs with cached state that predates the reset, and would
> not set up the phase offset measurement block again. The device CPU
> reset at the end of a flash update already allows the same.

[Severity: Low]
This describes an existing problem in the flash update path, and this patch
fixes it. Should the patch carry a Fixes: tag for that?

Before this patch, zl3073x_devlink_flash_finish() reset the device CPU
through zl3073x_flash_mode_leave() and then called
zl3073x_dev_start(zldev, true). If that start failed partway through
zl3073x_dev_state_fetch(), or returned early because the ready bit was not
yet set, a later DRIVER_REINIT reload called zl3073x_dev_start(zldev,
false). That path skipped both the state fetch and
zl3073x_dev_phase_meas_setup().

The patch is presented only as preparation for FW_ACTIVATE. Without a
Fixes: tag, it probably won't be picked up for stable trees.

> diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c
> index 27a55d810d5b0..5495d2c67848a 100644
> --- a/drivers/dpll/zl3073x/core.c
> +++ b/drivers/dpll/zl3073x/core.c

[ ... ]

> @@ -895,19 +893,16 @@ int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full)
>  		return 0;
>  	}
>  
> -	if (full) {
> -		/* Fetch device state */
> -		rc = zl3073x_dev_state_fetch(zldev);
> -		if (rc)
> -			return rc;
> +	/* Fetch device state */
> +	rc = zl3073x_dev_state_fetch(zldev);
> +	if (rc)
> +		return rc;

[Severity: Medium]
Does this lose the cached NCO frequency offset on a DRIVER_REINIT reload?

Before this patch, zl3073x_devlink_reload_up() called
zl3073x_dev_start(zldev, false), so zldev->chan[].df_offset was kept
across the reload. Now the path is:

zl3073x_devlink_reload_up()
  zl3073x_dev_start()
    zl3073x_dev_state_fetch()
      zl3073x_chan_state_fetch()

and zl3073x_chan_state_fetch() does this unconditionally:

drivers/dpll/zl3073x/chan.c:zl3073x_chan_state_fetch() {
    ...
	/* If firmware left the channel in NCO mode, mark df_offset as
	 * unknown - we cannot know whether the preconditions for a valid
	 * nco_auto_read capture were met.
	 */
	if (zl3073x_chan_mode_is_nco(chan))
		chan->df_offset = ZL_DPLL_DF_OFFSET_UNKNOWN;
    ...
}

On DRIVER_REINIT nothing resets the hardware. reload_down only runs
zl3073x_dev_stop(). If the driver itself put the channel into NCO mode,
the channel stays in NCO mode with a known offset. That offset came from
zl3073x_chan_nco_mode_set() or from adjfine.
zl3073x_chan_state_update() keeps df_offset in NCO mode on purpose.

After the reload, the cached value is ZL_DPLL_DF_OFFSET_UNKNOWN, and
zl3073x_dpll_nco_pin_ffo_get() returns -ENODATA:

	df_offset = zl3073x_chan_df_offset_get(chan);
	if (df_offset == ZL_DPLL_DF_OFFSET_UNKNOWN)
		return -ENODATA;

This lasts until user space calls adjfine again or leaves and re-enters
NCO mode. Re-entering means going through FREERUN, and
zl3073x_chan_nco_mode_set() from FREERUN also marks the offset unknown.

The commit message says "A DRIVER_REINIT reload is rare, so fetching the
state again there costs little", but it doesn't mention this lost state.
Should df_offset be preserved across a DRIVER_REINIT reload, or should the
NCO check in zl3073x_chan_state_fetch() apply only when the firmware set
NCO mode?

The code is the same at the end of the series: "dpll: zl3073x: add device
reset via devlink reload" calls zl3073x_dev_start() unconditionally from
reload_up for both actions and doesn't change chan.c.

>  
> -		/* Setup phase offset measurement block */
> -		rc = zl3073x_dev_phase_meas_setup(zldev);
> -		if (rc) {
> -			dev_err(zldev->dev,
> -				"Failed to setup phase measurement\n");
> -			return rc;
> -		}
> +	/* Setup phase offset measurement block */
> +	rc = zl3073x_dev_phase_meas_setup(zldev);
> +	if (rc) {
> +		dev_err(zldev->dev, "Failed to setup phase measurement\n");
> +		return rc;
>  	}

[ ... ]

> diff --git a/drivers/dpll/zl3073x/devlink.c b/drivers/dpll/zl3073x/devlink.c
> index 218b08fd8a306..10143ec81a116 100644
> --- a/drivers/dpll/zl3073x/devlink.c
> +++ b/drivers/dpll/zl3073x/devlink.c
> @@ -125,7 +125,7 @@ zl3073x_devlink_reload_up(struct devlink *devlink,
>  	}
>  
>  	/* Restart normal operation */
> -	rc = zl3073x_dev_start(zldev, false);
> +	rc = zl3073x_dev_start(zldev);
>  	if (rc)
>  		dev_warn(zldev->dev, "Failed to re-start normal operation\n");

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203180627.215256-1-ivecera%40redhat.com
Technical Details
Message-ID: <179641050045.3146.1515029809826961628@kernel.org>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ro.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377558-linux-kernel-netdev=dewy.ru
References: <20261203180627.215256-3-ivecera@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ro.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377558-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/3] dpll: zl3073x: always fetch device state on start
Date: Fri, 04 Dec 2026 18:55:00 +0000
Organization: Usenet Network
Message-ID: <179641050045.3146.1515029809826961628@kernel.org>
References: <20261203180627.215256-3-ivecera@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2836304"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:fbaqz21QMzaRlcpKH1oZfhN92uU= sha256:hNncT5CHKddrgYQ7LsaP4XezgJ66P5Kf3mGHirBPAIY=
	sha1:+C01a267xOdisk4CwePstFkj+6w= sha256:0+xeVbtfBeb9T+KumCEx1KNMgYH9g88vy8JyuB1sV5g=
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 5D654117CA1; Fri,  4 Dec 2026 21:55:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.642
X-Spam-Status: No, score=-3.642 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.142, 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 Zu4xnbGd28hF;
	Fri,  4 Dec 2026 21:55:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-377558-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 3C47D117C99; Fri,  4 Dec 2026 21:55:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id DA67460437C; Fri,  4 Dec 2026 18:55:05 +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=1796410503;
	b=L6UDLDxqPK28ocgy3XOfCKFne8w3pHDou2tDpGhpgthEZ9v+y+8rYNwXKhfgB++HKRJx
	 C63AT7O+TnSla6FPS1Y5UETVNsRxjp7v14AUi5oxv7rgOHYGy/J/LN2fixS3lH9YaE0Pp
	 OviZOrxUt1lPLre6O4AP9lCforc8OcOVs/F/YnobTsuzDxyEzLI2+hrvG8x+sspt9/UU+
	 QbxnRpzfvYvr6PPa1HfEUFnox+EgdWhzAW792/Vam2YB8gUyYht9QVuK2RNAZAcAWAQY3
	 XeF9bAkOEMpZCRwFGUaAYG2IrjunLb8UKst17Jrr1rbzvjD5OwZNg0WFSdWOOuXIDkw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796410503;
	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=oSwX5q6XO6HbTxpz26deDpM0gI+8b6kfna23c93KbJo=;
	b=oc5No5q+Z7QBXGa9yj2ytsSDkGQwG2Bt2PdQb+4tkKy+vkYR1wcrsOL8R1gXTTWtvswg
	 hDmqFIN2hTt8X6bzw1iZGbH8/5fk4TdAqa6ZuXAQCkxgfU1aba5rIBddIbkUrkEVA3b/u
	 FEkZaUe7YZJklP92nyoSO4cLmNizJ+3Dv4/St/4lScTi370RWtlFlnhdVgPZI37ISKBxi
	 CiI6GzuUavhv7w57w+JMVu9FWYC1/2pmJRZl0exOZ5bbEiJ8fZv7xX2FQ6x8pNrVyE6gy
	 T/nh/uuyfO5AblKFG2wMGan5occoFGtvMp/dEo3qdZXJalXBThSg5YXNzhA+pfIHhqA==
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=L1nQ+HDT;
	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 09C6D606A335;
	Fri,  4 Dec 2026 18:55:03 +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=L1nQ+HDT
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=1796410502;
	b=CIxt0+rVNmt8sxnb8F3m2aSWatYKXf5yZQeT3Gcw9pb/ann8WgR6CkCyYgbkGG0OjQfm
	 ZHUctO3O4SI4mIAQ8DxPgmO09xE8Kr1IgHbqLVktaf4p47O4K4U9R6k8c3Pg+Izt1Xivp
	 EsYTQlOve2CjHbwrQGLN7ixW6i7dGHS9HYgIcE8ro3Zwv0sSvviqP+wsjnSchtIFJ16pW
	 oOhX57C9Bl2Cacx1U1ke6qugaSTDg9SQT4Iz9NAsuTy27rShvoagMQI6SXC8+1gq940GN
	 g6S5QKdalyJOqaQ8skPPSvpAHJ0/9DOKdsY+1K7cZn3fgWg3IxYwalfrCEvZGORk9sA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796410502;
	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=oSwX5q6XO6HbTxpz26deDpM0gI+8b6kfna23c93KbJo=;
	b=E3RaBRjn89Ksyv3aG3VoVQZ2sAXeN9AP6JDM4AnDFqopKk8kqnWLWYz3uA0QdNuJHLmm
	 E6oFmyt2J96194DPuOxRvmBJ7r2ngiO3H4NFIxi5eoMtxNNWiktlhbDvUJb5UpIf1kowi
	 6emXdBPvw0itwgo36LgM0QfX2Ao5ga2OiMSvLR9tKptzYfAgkU3k7RgJ0LsvkWKA/nLje
	 UV+rPL13CEPPBIgE8+yDvc7X6Ij0N+v9ocq7o8EQwfywAzx8lE+vsOsF+bxg+H2RJExVn
	 nDW/AxdrVrWyoFQR8BBxEUOVW6Cga4WqE3fnVwEgZG6dSfT0UUUxKKhAs1fZOhuuezg==
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=L1nQ+HDT;
	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 234F9606A322;
	Fri,  4 Dec 2026 18:55:01 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3ABC1F00A06;
	Fri,  4 Dec 2026 18:55:00 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796410501;
	bh=oSwX5q6XO6HbTxpz26deDpM0gI+8b6kfna23c93KbJo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=L1nQ+HDT1SgKRSKDKD+SIJOvKLDDIKukC+JZeG1wWvHDE6NLVpSU7I2jEpQoabjf+
	 BjqR0YIKPZiYmFocnZD0g5ZNhkrMtd8NHILzcJ10864xEaU93XbENlSPcz02hQYsr6
	 mYhGFa3p6R3QLvuY/JOqBYhXIXyt/AQdvt25x4INFobmQrgEqVWtngqV/MySmDDEff
	 6rCN6WvF6WPitLWQ+JEKagiC+QyptlRpZt1zrTR6sJAiNyhBn/fxl/AhkKItfl+oXb
	 HnXpkJBFqvmoJp7IS1w+6ABM/EKIJU8MkUN9B8YcmAvbGOwbqWCgr+IoJ9UG0yW23+
	 yV1+LlP2obPeg==
X-Cc: netdev@vger.kernel.org, jiri@resnulli.us, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
 min.li@microchip.com, vadim.fedorenko@linux.dev,
 arkadiusz.kubalewski@intel.com, linux-doc@vger.kernel.org
X-In-Reply-To: <20261203180627.215256-3-ivecera@redhat.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