Commit 80079353 authored by Pali Rohár's avatar Pali Rohár Committed by Wim Van Sebroeck

watchdog: armada_37xx_wdt: Fix .set_timeout callback

ioctl(WDIOC_SETTIMEOUT) calls .set_timeout and .ping callbacks and it is
expected that it changes current watchdog timeout.

armada_37xx_wdt's .ping callback just reping counter 0 and does not touch
counter 1 used for timeout. So it is needed to set counter 1 to the new
value in .set_timeout callback to ensure ioctl(WDIOC_SETTIMEOUT)
functionality. Fix it.

Fixes: 54e3d9b5 ("watchdog: Add support for Armada 37xx CPU watchdog")
Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20220726085612.10672-1-pali@kernel.orgSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 74b31987
......@@ -179,6 +179,8 @@ static int armada_37xx_wdt_set_timeout(struct watchdog_device *wdt,
dev->timeout = (u64)dev->clk_rate * timeout;
do_div(dev->timeout, CNTR_CTRL_PRESCALE_MIN);
set_counter_value(dev, CNTR_ID_WDOG, dev->timeout);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment