aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Bhushan <[email protected]>2023-10-09 10:10:36 +0530
committerWim Van Sebroeck <[email protected]>2023-10-29 19:45:08 +0100
commitcc5cfc112a62a4e97ed068513928f5cafd0e6285 (patch)
tree4ee2f49a3d9ea0a259442dd30468d56ae72f3cf4
parentcd09da4703775d458fd5d0916ec22694b7f55d02 (diff)
drivers: watchdog: marvell_gti: fix zero pretimeout handling
When pretimeout is set to 0 then do not reprogram timer with zero timeout, this will reset device immediately. Also disable interrupt to stop pretimeout notification. Signed-off-by: Bharat Bhushan <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/marvell_gti_wdt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/watchdog/marvell_gti_wdt.c b/drivers/watchdog/marvell_gti_wdt.c
index fcf5d3a8622d..e8e95c4a6a54 100644
--- a/drivers/watchdog/marvell_gti_wdt.c
+++ b/drivers/watchdog/marvell_gti_wdt.c
@@ -190,6 +190,13 @@ static int gti_wdt_set_pretimeout(struct watchdog_device *wdev,
struct gti_wdt_priv *priv = watchdog_get_drvdata(wdev);
struct watchdog_device *wdog_dev = &priv->wdev;
+ if (!timeout) {
+ /* Disable Interrupt */
+ writeq(GTI_CWD_INT_ENA_CLR_VAL(priv->wdt_timer_idx),
+ priv->base + GTI_CWD_INT_ENA_CLR);
+ return 0;
+ }
+
/* pretimeout should 1/3 of max_timeout */
if (timeout * 3 <= wdog_dev->max_timeout)
return gti_wdt_settimeout(wdev, timeout * 3);