From: Guenter Roeck <linux@roeck-us.net>
To: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
Chris Paterson <Chris.Paterson2@renesas.com>,
Biju Das <biju.das@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Jacopo Mondi <jacopo@jmondi.org>
Subject: Re: [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M
Date: Tue, 15 Nov 2022 05:28:11 -0800 [thread overview]
Message-ID: <20221115132811.GA4189373@roeck-us.net> (raw)
In-Reply-To: <20221103223956.50575-2-fabrizio.castro.jz@renesas.com>
On Thu, Nov 03, 2022 at 10:39:54PM +0000, Fabrizio Castro wrote:
> The setting for the RZ/V2M watchdog cannot be changed once
> the watchdog has been enabled, unless the IP gets reset.
> The current implementation of the restart callback assumes
> that the watchdog is not enabled, but that's not always the
> case, and it leads to longer than necessary reboot times if
> the watchdog is already running.
>
> Always reset the RZ/V2M watchdog first, so that we can always
> restart quickly.
>
> Fixes: ec122fd94eeb ("watchdog: rzg2l_wdt: Add rzv2m support")
> Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
> index 974a4194a8fd..00438ceed17a 100644
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -145,10 +145,10 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> {
> struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
>
> - clk_prepare_enable(priv->pclk);
> - clk_prepare_enable(priv->osc_clk);
> -
> if (priv->devtype == WDT_RZG2L) {
> + clk_prepare_enable(priv->pclk);
> + clk_prepare_enable(priv->osc_clk);
> +
> /* Generate Reset (WDTRSTB) Signal on parity error */
> rzg2l_wdt_write(priv, 0, PECR);
>
> @@ -157,6 +157,11 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> } else {
> /* RZ/V2M doesn't have parity error registers */
>
> + reset_control_reset(priv->rstc);
> +
> + clk_prepare_enable(priv->pclk);
> + clk_prepare_enable(priv->osc_clk);
> +
> wdev->timeout = 0;
>
> /* Initialize time out */
> --
> 2.34.1
>
next prev parent reply other threads:[~2022-11-15 13:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 22:39 [PATCH 0/3] Add Watchdog support for RZ/V2M EVK v2 Fabrizio Castro
2022-11-03 22:39 ` [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M Fabrizio Castro
2022-11-14 13:59 ` Geert Uytterhoeven
2022-11-15 13:28 ` Guenter Roeck [this message]
2022-11-17 11:39 ` Fabrizio Castro
2023-05-07 15:36 ` Wim Van Sebroeck
2023-05-08 13:29 ` Guenter Roeck
2023-05-09 8:13 ` Fabrizio Castro
2023-05-09 8:12 ` Fabrizio Castro
2022-11-03 22:39 ` [PATCH 2/3] arm64: dts: renesas: r9a09g011: Add watchdog node Fabrizio Castro
2022-11-14 14:00 ` Geert Uytterhoeven
2022-11-03 22:39 ` [PATCH 3/3] arm64: dts: renesas: v2mevk2: Enable watchdog Fabrizio Castro
2022-11-14 14:02 ` Geert Uytterhoeven
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=20221115132811.GA4189373@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Chris.Paterson2@renesas.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=biju.das@bp.renesas.com \
--cc=devicetree@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=fabrizio.castro@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=jacopo@jmondi.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=robh+dt@kernel.org \
--cc=wim@linux-watchdog.org \
/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
all inboxes | Powered by JetHome®