* [PATCH] watchdog: renesas_wdt: add grace period before rebooting
@ 2021-01-18 9:45 Wolfram Sang
2021-01-18 16:03 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2021-01-18 9:45 UTC (permalink / raw)
To: linux-watchdog; +Cc: linux-renesas-soc, Wolfram Sang
arm64 does not have a grace period after calling reset handlers. It is
rightfully assumed that watchdog drivers should wait because they know
the time needed. Implement this for the Renesas watchdog driver.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/watchdog/renesas_wdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index d2b5074bca65..5791198960e6 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -151,6 +151,9 @@ static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
rwdt_write(priv, RWTCSRA_TME, RWTCSRA);
+ /* wait 2 cycles, so watchdog will trigger */
+ udelay(DIV_ROUND_UP(2 * 1000000, priv->clk_rate));
+
return 0;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: renesas_wdt: add grace period before rebooting
2021-01-18 9:45 [PATCH] watchdog: renesas_wdt: add grace period before rebooting Wolfram Sang
@ 2021-01-18 16:03 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-01-18 16:03 UTC (permalink / raw)
To: Wolfram Sang, linux-watchdog; +Cc: linux-renesas-soc
On 1/18/21 1:45 AM, Wolfram Sang wrote:
> arm64 does not have a grace period after calling reset handlers. It is
> rightfully assumed that watchdog drivers should wait because they know
> the time needed. Implement this for the Renesas watchdog driver.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@oeck-us.net>
> ---
> drivers/watchdog/renesas_wdt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index d2b5074bca65..5791198960e6 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -151,6 +151,9 @@ static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
>
> rwdt_write(priv, RWTCSRA_TME, RWTCSRA);
>
> + /* wait 2 cycles, so watchdog will trigger */
> + udelay(DIV_ROUND_UP(2 * 1000000, priv->clk_rate));
> +
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-18 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 9:45 [PATCH] watchdog: renesas_wdt: add grace period before rebooting Wolfram Sang
2021-01-18 16:03 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).