aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Sang <[email protected]>2021-01-18 10:45:58 +0100
committerWim Van Sebroeck <[email protected]>2021-02-07 14:41:22 +0100
commite007372bfb5f19d22ebfbbcb7c56346321398077 (patch)
tree3c14c8ddab55a7edc5dab9902315c8c744cac508
parentac288a7b1a98a11e3269573b1de05fb35b80e051 (diff)
watchdog: renesas_wdt: add grace period before rebooting
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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/renesas_wdt.c3
1 files changed, 3 insertions, 0 deletions
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;
}