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=1796394952; b=g8bAr4RwfpvVDN/1emeitlEXrAwDQCi4LzatQOYPtYNNn98fk3NalgpePHJ+xUiTlWQj YNfJSG5ivVdB6SdiD/1dByLoO3Cf1R3qYdA2BhNclWCqAX4tgCWaGgv33fKjzdnMJ0EpD l1mw7yzkLLroKl19e73p0O6ELMsMYlgtLnR/7Cvdg64RUyMbuSuDgm8cGWNZ5PJFMTdGd Dq57QoJPfkDjVS544X2tE+QC++GZf0Y1XxAA1aNJJEyOHs6UcpCUkdwWwfNnNfNB1Y9an /bzf1A4uc7ijVcLxzLoHL/Y5ZbaEIenZ8QfcrjE8jAtisfzsRMwtPDwML1QU6NXyXBQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796394952; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=xJNDMKx6H7xf7cy23fpWofumoh572euB8QZcLTRFlUw=; b=Bd8FbTmJPxDV0mtmxXlMkqGVI4O6/eSg/8nfLJRwnsJUYV5crPWERAGiwO2aH1dWBX41 bYmdCj0LU/dT4ApxnhjvxNUxX49DsFtLGcJk6W3dEP93YrI0gO801uI/vOrA50Jj/h9R/ nsHskxTO+LfzhlLjmbDPhxTOw8SSttehQtZUsyyOkd6JED3ZcYHqMmAPbhypAZTA2Vrs0 zKZ+nIoEsk5ZFh/k1a6NDvChuimYIY5IoTvmltyqpzL94cukxYN22CWkgFLNsHHD4E1Hm WGGT2zjO2Dk+8oOxAZi569Xp15YBXU0qTwBu0TCluC2+3/4vbNv7Sh81lZ1RdzCofoQ== 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="ExgHwx/Z"; 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 79C38606A685; Fri, 4 Dec 2026 14:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ExgHwx/Z Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7B4A1F000C2; Fri, 4 Dec 2026 14:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796394952; bh=xJNDMKx6H7xf7cy23fpWofumoh572euB8QZcLTRFlUw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ExgHwx/ZlylzEym1xJYLUAEvXzsKdJ8y7YoKslyVRrJSShA7hZ5aji+wU367JEAvw Jhbd6WnrQ2fqMXXX1CJr/iOpe4ly41vj9QWHy9m8jrvXv6/94hbI0CYEgXzmE7hWhs WbcQrqOp7ufCRavA3JLPispP4iT7d2QFCS24oJK+ZUeUmmddThuPx3nQOYUmSnT4G/ tyqH225SubdWJNR18vZRnfMyTJEaJJHw4xkCdWlf/RKhZvZMhf++Jcsr3NDULm9Vvo 7+5wiKCZQp9crl7oay8kujarj6PjidIedB6+5RHDRLXT8vYmKyN7KcE+bn/yCajlBB o2j1URdYa7O7w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 3/3] watchdog: starfive: Add jhb100 support Reply-To: sashiko-reviews@lists.linux.dev To: "Henry Qin" Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204135336.632-4-henry.qin@starfivetech.com> References: <20261204135336.632-1-henry.qin@starfivetech.com> <20261204135336.632-4-henry.qin@starfivetech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 14:35:51 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] watchdog: starfive: starfive_wdt_start() discards wdt->reload on JHB100 resume - [Low] watchdog: starfive: starfive_wdt_int_clr() writes RESTART before LOAD -- commit ee0848390c3f02cfdb4636176c3d8234c91dfb17 Author: Henry Qin watchdog: starfive: Add jhb100 support This commit adds watchdog support for the StarFive JHB100 SoC, introducing its register layout, unlock and restart keys, and first-timeout reset mode. > diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-= wdt.c > index 24909afacd4ee..045b922c76ab8 100644 > --- a/drivers/watchdog/starfive-wdt.c > +++ b/drivers/watchdog/starfive-wdt.c [ ... ] > @@ -144,6 +170,23 @@ static const struct starfive_wdt_variant starfive_wd= t_jh7110_variant =3D { > .double_timeout =3D true, > }; > =20 > +/* Register layout and configuration for the JHB100 */ > +static const struct starfive_wdt_variant starfive_wdt_jhb100_variant =3D= { > + .control =3D STARFIVE_WDT_JHB100_CONTROL, > + .load =3D STARFIVE_WDT_JHB100_LOAD, > + .enable =3D STARFIVE_WDT_JHB100_CONTROL, > + .value =3D STARFIVE_WDT_JHB100_VALUE, > + .unlock =3D STARFIVE_WDT_JHB100_LOCK, > + .unlock_key =3D STARFIVE_WDT_JHB100_UNLOCK_KEY, > + .restart =3D STARFIVE_WDT_JHB100_RESTART, > + .restart_key =3D STARFIVE_WDT_JHB100_RESTART_KEY, > + .rst_mode =3D STARFIVE_WDT_JHB100_RST_MODE, > + .enrst_shift =3D STARFIVE_WDT_JHB100_RST_EN_SHIFT, > + .en_shift =3D STARFIVE_WDT_EN_SHIFT, > + .intclr_check =3D false, > + .double_timeout =3D false, > +}; [Severity: Medium] Does leaving .reload unset here discard wdt->reload on JHB100 system resume? On resume, starfive_wdt_resume() calls starfive_wdt_start(wdt, wdt->reload): drivers/watchdog/starfive-wdt.c:starfive_wdt_start() { ... starfive_wdt_set_reload_count(wdt, count); if (count !=3D wdt->count) starfive_wdt_set_count(wdt, wdt->count); starfive_wdt_enable(wdt); ... } With variant->reload unset, starfive_wdt_set_reload_count() only writes wdt->reload to LOAD without latching the counter. The next call then overwrites LOAD with wdt->count before starfive_wdt_enable() reloads the counter from LOAD, resetting the watchdog to the full timeout. [ ... ] > @@ -255,7 +299,12 @@ static int starfive_wdt_int_clr(struct starfive_wdt = *wdt) > return dev_err_probe(wdt->wdd.parent, ret, > "watchdog is not ready to clear interrupt.\n"); > } > - writel(STARFIVE_WDT_INTCLR, wdt->base + wdt->variant->int_clr); > + > + /* JHB100 restarts the counter by writing the restart key */ > + if (wdt->variant->restart) > + writel(wdt->variant->restart_key, wdt->base + wdt->variant->restart); > + else > + writel(STARFIVE_WDT_INTCLR, wdt->base + wdt->variant->int_clr); > =20 > return 0; > } [Severity: Low] Should writing the JHB100 RESTART key happen in starfive_wdt_set_reload_count() instead of starfive_wdt_int_clr()? In starfive_wdt_keepalive(), starfive_wdt_int_clr() runs before starfive_wdt_set_reload_count(), so RESTART is written before LOAD and the LOAD update does not take effect for that ping. In starfive_wdt_start(), it also writes RESTART while disabled and before LOAD is programmed. Skipping the interrupt-clear write when variant->int_clr is unset and extending variant->reload in starfive_wdt_set_reload_count() with a reload key would keep LOAD written before RESTART and avoid duplicating the reload mechanism. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204135336.632-= 1-henry.qin@starfivetech.com?part=3D3