[PATCH 5.12 190/292] watchdog: keembay: Upadate WDT pretimeout for every update in timeout

From: Greg Kroah-Hartman
Date: Mon Jul 19 2021 - 14:10:45 EST

From: Shruthi Sanil <shruthi.sanil@xxxxxxxxx>

[ Upstream commit 0f7bfaf10c0abc979220442bae2af4f1f869c41e ]

The pre-timeout value to be programmed to the register has to be
calculated and updated for every change in the timeout value.
Else the threshold time wouldn't be calculated to its
corresponding timeout.

Fixes: fa0f8d51e90d ("watchdog: Add watchdog driver for Intel Keembay Soc")
Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Tested-by: Kris Pan <kris.pan@xxxxxxxxx>
Signed-off-by: Shruthi Sanil <shruthi.sanil@xxxxxxxxx>
Link: https://lore.kernel.org/r/20210517174953.19404-3-shruthi.sanil@xxxxxxxxx
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Signed-off-by: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
drivers/watchdog/keembay_wdt.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/keembay_wdt.c b/drivers/watchdog/keembay_wdt.c
index f2f5c9fae29c..b2afeb4a60e3 100644
--- a/drivers/watchdog/keembay_wdt.c
+++ b/drivers/watchdog/keembay_wdt.c
@@ -109,6 +109,7 @@ static int keembay_wdt_set_timeout(struct watchdog_device *wdog, u32 t)
wdog->timeout = t;
+ keembay_wdt_set_pretimeout_reg(wdog);

return 0;