Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: ivecera@redhat.com
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
Subject: Re: [PATCH net-next 3/3] dpll: zl3073x: add device reset via devlink reload
Date: Fri, 04 Dec 2026 18:55:01 +0000	[thread overview]
Message-ID: <179641050190.3146.13785948564015380782@kernel.org> (raw)
In-Reply-To: <20261203180627.215256-4-ivecera@redhat.com>

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

      reply	other threads:[~2026-12-04 18:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 18:06 [PATCH net-next 0/3] dpll: zl3073x: add device reset via devlink reload Ivan Vecera
2026-12-03 18:06 ` [PATCH net-next 1/3] dpll: zl3073x: factor device CPU reset into a helper Ivan Vecera
2026-12-03 18:06 ` [PATCH net-next 2/3] dpll: zl3073x: always fetch device state on start Ivan Vecera
2026-12-04 18:55   ` netdev-bot+sashiko
2026-12-03 18:06 ` [PATCH net-next 3/3] dpll: zl3073x: add device reset via devlink reload Ivan Vecera
2026-12-04 18:55   ` netdev-bot+sashiko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179641050190.3146.13785948564015380782@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=min.li@microchip.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox