]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
watchdog: reset last_hw_keepalive time at start
authorTero Kristo <t-kristo@ti.com>
Thu, 12 Mar 2020 09:58:06 +0000 (11:58 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:41:33 +0000 (10:41 +0200)
BugLink: https://bugs.launchpad.net/bugs/1876361
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/watchdog/watchdog_dev.c

index ce04edc69e5f0de8e95b39c2d62e6bde3bb0ac86..c4147e93aa7d4bb7b6060620e47159d871952895 100644 (file)
@@ -282,6 +282,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);
        }