summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2020-03-12 12:58:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-02 18:23:02 +0300
commit21abb3500db17244cbb1420d43e30776aa87268d (patch)
treece844bd2f44e5fbdc83538d9a7e0b4078c012c54
parent1dd76d055170b4cf5bd3408099fa14b1c9cb1b9b (diff)
downloadlinux-21abb3500db17244cbb1420d43e30776aa87268d.tar.xz
watchdog: reset last_hw_keepalive time at start
[ Upstream commit 982bb70517aef2225bad1d802887b733db492cc0 ] Currently the watchdog core does not initialize the last_hw_keepalive time during watchdog startup. This will cause the watchdog to be pinged immediately if enough time has passed from the system boot-up time, and some types of watchdogs like K3 RTI does not like this. To avoid the issue, setup the last_hw_keepalive time during watchdog startup. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200302200426.6492-3-t-kristo@ti.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/watchdog/watchdog_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 977fe74e5abe..9e17d933ea94 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -237,6 +237,7 @@ static int watchdog_start(struct watchdog_device *wdd)
if (err == 0) {
set_bit(WDOG_ACTIVE, &wdd->status);
wd_data->last_keepalive = started_at;
+ wd_data->last_hw_keepalive = started_at;
watchdog_update_worker(wdd);
}