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=1796410503; b=WHAZF2t3fctYcr0yYz40Kqbu9itqmWqQHXPOtpEuLNJa5smu07ZuNnWhSt9mOOFDus9a vFugqi+gmIhDV7At82WEOPi+VRJx0ujQdQsQqYF5lEvUgduN9i5Umy52XOfoBSHN2PsAb 6wQjv/WHSFtipk0YptsNiC8nD4QNlWePyK6gYOvyZL8BomZWhsS7+SxxO/n8EVriWANaa BZ6iuRvYeu+BG45P1mq3NQ2/7Vg2QBxTHxZW30PAq5T1ATPs0IO20j+Yw+md4ELHWqUIf lrK+hBN4EK8hHpLEvEmvR/I+zXkOgc4oa7KXNoxMI0qaA6Z8Su1bXHKZPSmBP8HgKOA== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F92C1F00936; Fri, 4 Dec 2026 18:55:02 +0000 (UTC) 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== Subject: Re: [PATCH net-next 3/3] dpll: zl3073x: add device reset via devlink reload 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:01 +0000 Message-ID: <179641050190.3146.13785948564015380782@kernel.org> In-Reply-To: <20261203180627.215256-4-ivecera@redhat.com> References: <20261203180627.215256-4-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] 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