From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3ABC1F00A06; Fri, 4 Dec 2026 18:55:00 +0000 (UTC) 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== Subject: Re: [PATCH net-next 2/3] dpll: zl3073x: always fetch device state on start 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 Date: Fri, 04 Dec 2026 18:55:00 +0000 Message-ID: <179641050045.3146.1515029809826961628@kernel.org> In-Reply-To: <20261203180627.215256-3-ivecera@redhat.com> References: <20261203180627.215256-3-ivecera@redhat.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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