From: Wolfram Sang Date: Mon, 18 Jan 2021 09:45:58 +0000 (+0100) Subject: watchdog: renesas_wdt: add grace period before rebooting X-Git-Tag: v5.12-rc1~119^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e007372bfb5f19d22ebfbbcb7c56346321398077;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20210118094558.36814-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c index d2b5074bca65c..5791198960e6c 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; }