🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27076

Re: [PATCH net-next 3/3] dpll: zl3073x: add device reset via devlink reload

#27076
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 18:55
175 lines
13816 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] The new FW_ACTIVATE path in zl3073x_devlink_reload_up() resets
  the device CPU with zl3073x_dev_hw_reset() and then calls…
- [Low] The patch also fixes a bug in the existing DRIVER_REINIT reload,
  but it does this inside a feature commit and gives no Fixes: tag.

--

dpll: zl3073x: add device reset via devlink reload

This commit adds the devlink fw_activate reload action. The action resets
the device so the firmware reboots and reloads its configuration from
flash. The patch also moves the clock_id update into a helper that only
driver_reinit uses, and makes reload_up() return the error from
zl3073x_dev_start().

> diff --git a/drivers/dpll/zl3073x/devlink.c b/drivers/dpll/zl3073x/devlink.c
> index 10143ec81a116..0ff93889acd50 100644
> --- a/drivers/dpll/zl3073x/devlink.c
> +++ b/drivers/dpll/zl3073x/devlink.c

[ ... ]

> @@ -124,14 +121,51 @@ zl3073x_devlink_reload_up(struct devlink *devlink,
>  		zldev->clock_id = val.vu64;
>  	}
>  
> -	/* Restart normal operation */
> -	rc = zl3073x_dev_start(zldev);
> -	if (rc)
> -		dev_warn(zldev->dev, "Failed to re-start normal operation\n");
> +	return rc;
> +}
>  
> -	*actions_performed = BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT);
> +static int
> +zl3073x_devlink_reload_up(struct devlink *devlink,
> +			  enum devlink_reload_action action,
> +			  enum devlink_reload_limit limit,
> +			  u32 *actions_performed,
> +			  struct netlink_ext_ack *extack)
> +{
> +	struct zl3073x_dev *zldev = devlink_priv(devlink);
> +	int rc, restart_rc;
> +
> +	*actions_performed = 0;
> +	switch (action) {

[ ... ]

> +	case DEVLINK_RELOAD_ACTION_FW_ACTIVATE:
> +		/* Reset the device CPU to reboot the firmware and reload the
> +		 * configuration from flash. On failure, normal operation is
> +		 * still restarted below on a best-effort basis.
> +		 */
> +		rc = zl3073x_dev_hw_reset(zldev);
> +		if (rc) {
> +			NL_SET_ERR_MSG_MOD(extack, "Hardware reset failed");
> +			break;
> +		}
> +		*actions_performed |= BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE);
> +		break;

[Severity: Medium]
After the reset, does anything wait for the firmware to finish loading
its configuration from flash?

After the reset, zl3073x_dev_hw_reset() only sleeps for a fixed time and
then checks the reset flag once:

drivers/dpll/zl3073x/core.c:zl3073x_dev_hw_reset() {
    ...
	msleep(500);

	/* Read again the reset status register */
	rc = zl3073x_read_u8(zldev, ZL_REG_RESET_STATUS, &reset_status);
    ...
	if (reset_status & ZL_REG_RESET_STATUS_RESET) {
    ...
}

zl3073x_dev_start() then reads ZL_REG_INFO once. If the ready bit is
clear, it returns success:

drivers/dpll/zl3073x/core.c:zl3073x_dev_start() {
    ...
	if (!FIELD_GET(ZL_INFO_READY, info)) {
		...
		dev_info(zldev->dev,
			 "FW not fully ready - missing or corrupted config\n");

		return 0;
	}
    ...
}

Suppose the firmware clears ZL_REG_RESET_STATUS_RESET before it sets
ZL_INFO_READY, or takes longer than 500ms to apply the configuration.
Wouldn't a device that is still booting then be treated as having a
missing configuration?

In that case reload_up() returns 0 with both FW_ACTIVATE and
DRIVER_REINIT set in actions_performed. devlink reports a successful
reload, but the DPLLs, pins and PTP clocks stay unregistered until
another reload is done.

Before this patch, this reset-then-start sequence only ran at the end of
a flash update. With this patch it can be triggered at any time with
"devlink dev reload ... action fw_activate".

Would a bounded poll of the reset flag and ZL_INFO_READY work better
here than the fixed delay?

> +	default:
> +		return -EOPNOTSUPP;
> +	}
>  
> -	return 0;
> +	/* Restart normal operation */
> +	restart_rc = zl3073x_dev_start(zldev);
> +	if (restart_rc)
> +		NL_SET_ERR_MSG_WEAK_MOD(extack,
> +					"Failed to re-start normal operation");
> +	else
> +		*actions_performed |= BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT);
> +
> +	return rc ? : restart_rc;

[Severity: Low]
This isn't a bug, but this change also fixes existing driver_reinit
behaviour. Should that fix be a separate patch with a Fixes: tag?

Before this patch, reload_up() logged a zl3073x_dev_start() failure with
dev_warn(). It then set DRIVER_REINIT in actions_performed and returned
0. By that point reload_down() had already unregistered the DPLLs and
pins.

As a result, devlink_reload() cleared reload_failed and updated the
reload stats as if the reload had worked, while the DPLLs stayed
unregistered.

That behaviour came from:

ebb1031c5137 ("dpll: zl3073x: Refactor DPLL initialization")
2df8e64e01c1 ("dpll: Add basic Microchip ZL3073x support")

The new code returns the restart error and only sets the DRIVER_REINIT
bit when the restart succeeds. Because this is mixed in with the new
FW_ACTIVATE support and has no Fixes: tag, stable trees with the reload
code will keep reporting success for a failed reload.

The other side effect, where a clock_id lookup failure now falls through
to the restart, doesn't seem reachable in practice.
zl3073x_devlink_register() calls devl_param_driverinit_value_set() for
CLOCK_ID, so devl_param_driverinit_value_get() can't fail here.

>  }
>  
>  void zl3073x_devlink_flash_notify(struct zl3073x_dev *zldev, const char *msg,

[ ... ]

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

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mi.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377559-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 3/3] dpll: zl3073x: add device reset via devlink reload
Date: Fri, 04 Dec 2026 18:55:01 +0000
Organization: Usenet Network
Message-ID: <179641050190.3146.13785948564015380782@kernel.org>
References: <20261203180627.215256-4-ivecera@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2836353"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/ZipbACtfD0KojU0Q8qb5dX9VW8= sha256:X+BoqZFX0OSVO4NLloYgOF/QZVWKI/KbrTrKz9siL+w=
	sha1:4umgSXOf6QZn8Dbkku4Ocwo1EaA= sha256:QFdY9eab3agdc8O04oY910lMoksK8ONckaDpVUiuuIA=
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 E8079117C99; Fri,  4 Dec 2026 21:55:22 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.641
X-Spam-Status: No, score=-3.641 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,
	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 aOOlupoemj7D;
	Fri,  4 Dec 2026 21:55:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377559-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id C82A4117C9E; Fri,  4 Dec 2026 21:55:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 63C282591C; Fri,  4 Dec 2026 18:55:07 +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=1796410504;
	b=agn9qAY/bZPymJuotQNP4KaEesC/NIymKumXew7JC/1ck5mWxGuyqnXnzYaquigfIHpy
	 8wLG/5b7hyNlO4LFEOZj3AS848ozN3pixpYghWqZyXmpe8cEnkih8zi3YrDfGcBX1D1Ag
	 jmkTaSdDlIz1PYbDqODrX/o4BwZAHoLBGWh/Cr0ondrQ+Tb/nquCH2FKrmC+rwExZhwLT
	 16W2eQMZSbvyczRMT8X56SWDGPtiynfgXyFuPpYBre0SPodhVjRvpw+GVjrfpioq9jpx3
	 FD26/KXT0Bh8e/48fBRHK7r5rs017mmiu4bUdmjcPcgmO9VH/XOgLrHltF8k490BkYw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796410504;
	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=FGHxAhADxg4gIr4+3goUwyLw8zq6LJb9iiFNYeWJkI8=;
	b=P9lSsd4GJfaJYQ+6J7kU7TE4uVpE6iVfCQRY/0QGEjlr3lqmZF2SUioYy7Pu8p+2sQjC
	 xpmqGd9jo1A72VJQupYZrtq411JxLEkom5rv2ubRLeAr6GPzpiPFRUwO4PaGs8QItXaCx
	 OYm3liajo4aIieDxZiko3REKZkcbzzFMd7AkhCT1zPOndGwZVD9fb5F1UMuquUu/7G7zP
	 KVLpkCkdMchXN0iYSBdjbjjqAu0bl3brbn8wj2mp4d1AT8MlMzsiJCk9qitUZkQj2wJ5c
	 vw7D9ZQY3zNWBKgIUl++ON/KsGf45RWi8GPvv3vsLmguFNbhGrnR1xkJYM+san/JuYA==
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=adVR4XNz;
	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 4C61D606A682;
	Fri,  4 Dec 2026 18:55:04 +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=adVR4XNz
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=1796410503;
	b=WHAZF2t3fctYcr0yYz40Kqbu9itqmWqQHXPOtpEuLNJa5smu07ZuNnWhSt9mOOFDus9a
	 vFugqi+gmIhDV7At82WEOPi+VRJx0ujQdQsQqYF5lEvUgduN9i5Umy52XOfoBSHN2PsAb
	 6wQjv/WHSFtipk0YptsNiC8nD4QNlWePyK6gYOvyZL8BomZWhsS7+SxxO/n8EVriWANaa
	 BZ6iuRvYeu+BG45P1mq3NQ2/7Vg2QBxTHxZW30PAq5T1ATPs0IO20j+Yw+md4ELHWqUIf
	 lrK+hBN4EK8hHpLEvEmvR/I+zXkOgc4oa7KXNoxMI0qaA6Z8Su1bXHKZPSmBP8HgKOA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796410503;
	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=FGHxAhADxg4gIr4+3goUwyLw8zq6LJb9iiFNYeWJkI8=;
	b=2AsXtZoiQRgecTAZIz4h0VRwy0+WmyOa1UBVUMAIBBqX9Xm09RsRD1Uw/Rtz52I3fPQ2
	 bhnSFwIzmR/U3dAnVAGcanRr0vkKDJHRiSbRiArIf4XunZAm/PnGJZmR5CYKvJbGCUdGv
	 wM1IOIKkgDP4zAdjVV5fnCSEQMayaoKOjk0KPte/AWSKTDNKSIeOZeVLoWyRQmiwTdHJS
	 P4zLz5NAMpQAqsRBxxzlSUk0rLDvv7twfLCBea6wyL2VDbjN7IuKwdkrHsiO85aEFz9RM
	 J8GhDIToLZyFoa312oO41C61sOVA5D4uBw1uJPDGjui/4JaHgTLhG44mRjaJaHxpzZQ==
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=adVR4XNz;
	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 6888B606A338;
	Fri,  4 Dec 2026 18:55:03 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F92C1F00936;
	Fri,  4 Dec 2026 18:55:02 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796410503;
	bh=FGHxAhADxg4gIr4+3goUwyLw8zq6LJb9iiFNYeWJkI8=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=adVR4XNzj3mMjLUN0sKesU36jNd+aUPg+g48ImypGADix2A6naVz3BsBCqGBXUVc3
	 GnJPBsTegog+gCOTyI31xiM5/Km0LbcPh6j/gIYN025XvNykYPlcmbgLctEBv24+Hm
	 j9L86zNBMeFp/fNw36Tiqaiw1FooNAtc+oDPn04FYcHqwTcvXoFTgdjI6ohhNK4G6o
	 x1PhT8cJgAJBC4cknm3oLG5kDVE8qdcnYPWlmfv46YakKBIK3Szq4+ZBggCmhA0Sem
	 9R2XeHxpsBwWRJ7BrPENUa+BWOBWQvgoC1I8BD+fAASRX2RFzZzPCJpiWDGmmCBxdn
	 iiCSm3vDwi0bQ==
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-4-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