2023-10-09 04:41:21

by Bharat Bhushan

[permalink] [raw]
Subject: [PATCH 2/2] drivers: watchdog: marvell_gti: Program the max_hw_heartbeat_ms

From: George Cherian <[email protected]>

Program the max_hw_heartbeat_ms value so that the watchdog_pretimeout
worker is activated. This kernel worker thread makes sure to ping the
watchdog in case the userspace is unable to do so. This kernel worker
ping will be done only till the full watchdog timeout there by
maintaining the watchdog functionality in case of a real hang.

Signed-off-by: George Cherian <[email protected]>
Signed-off-by: Bharat Bhushan <[email protected]>
---
drivers/watchdog/marvell_gti_wdt.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/marvell_gti_wdt.c b/drivers/watchdog/marvell_gti_wdt.c
index 25b7ce0f0738..bfe0c819248c 100644
--- a/drivers/watchdog/marvell_gti_wdt.c
+++ b/drivers/watchdog/marvell_gti_wdt.c
@@ -299,6 +299,7 @@ static int gti_wdt_probe(struct platform_device *pdev)

/* Maximum timeout is 3 times the pretimeout */
wdog_dev->max_timeout = max_pretimeout * 3;
+ wdog_dev->max_hw_heartbeat_ms = max_pretimeout * 1000;
/* Minimum first timeout (pretimeout) is 1, so min_timeout as 3 */
wdog_dev->min_timeout = 3;
wdog_dev->timeout = wdog_dev->pretimeout;
--
2.34.1


2023-10-11 14:51:52

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 2/2] drivers: watchdog: marvell_gti: Program the max_hw_heartbeat_ms

On Mon, Oct 09, 2023 at 10:10:37AM +0530, Bharat Bhushan wrote:
> From: George Cherian <[email protected]>
>
> Program the max_hw_heartbeat_ms value so that the watchdog_pretimeout
> worker is activated. This kernel worker thread makes sure to ping the
> watchdog in case the userspace is unable to do so. This kernel worker
> ping will be done only till the full watchdog timeout there by
> maintaining the watchdog functionality in case of a real hang.
>
> Signed-off-by: George Cherian <[email protected]>
> Signed-off-by: Bharat Bhushan <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/watchdog/marvell_gti_wdt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/watchdog/marvell_gti_wdt.c b/drivers/watchdog/marvell_gti_wdt.c
> index 25b7ce0f0738..bfe0c819248c 100644
> --- a/drivers/watchdog/marvell_gti_wdt.c
> +++ b/drivers/watchdog/marvell_gti_wdt.c
> @@ -299,6 +299,7 @@ static int gti_wdt_probe(struct platform_device *pdev)
>
> /* Maximum timeout is 3 times the pretimeout */
> wdog_dev->max_timeout = max_pretimeout * 3;
> + wdog_dev->max_hw_heartbeat_ms = max_pretimeout * 1000;
> /* Minimum first timeout (pretimeout) is 1, so min_timeout as 3 */
> wdog_dev->min_timeout = 3;
> wdog_dev->timeout = wdog_dev->pretimeout;
> --
> 2.34.1
>