mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watchdog: apple: set max_hw_heartbeat_ms instead of max_timeout
@ 2025-05-06 12:01 Florian Klink
  2025-05-06 12:31 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Klink @ 2025-05-06 12:01 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Wim Van Sebroeck, Guenter Roeck
  Cc: asahi, linux-arm-kernel, linux-watchdog, linux-kernel, Florian Klink

The hardware only supports timeouts slightly below 3mins, but by using
max_hw_heartbeat_ms we can let the kernel take care of supporting larger
timeouts than that requested from userspace.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 drivers/watchdog/apple_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/apple_wdt.c b/drivers/watchdog/apple_wdt.c
index 95d9e37df41c..6088a7554312 100644
--- a/drivers/watchdog/apple_wdt.c
+++ b/drivers/watchdog/apple_wdt.c
@@ -177,7 +177,7 @@ static int apple_wdt_probe(struct platform_device *pdev)
 
 	wdt->wdd.ops = &apple_wdt_ops;
 	wdt->wdd.info = &apple_wdt_info;
-	wdt->wdd.max_timeout = U32_MAX / wdt->clk_rate;
+	wdt->wdd.max_hw_heartbeat_ms = U32_MAX / wdt->clk_rate * 1000;
 	wdt->wdd.timeout = APPLE_WDT_TIMEOUT_DEFAULT;
 
 	wdt_ctrl = readl_relaxed(wdt->regs + APPLE_WDT_WD1_CTRL);
-- 
2.49.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] watchdog: apple: set max_hw_heartbeat_ms instead of max_timeout
  2025-05-06 12:01 [PATCH] watchdog: apple: set max_hw_heartbeat_ms instead of max_timeout Florian Klink
@ 2025-05-06 12:31 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2025-05-06 12:31 UTC (permalink / raw)
  To: Florian Klink, Sven Peter, Janne Grunau, Alyssa Rosenzweig,
	Neal Gompa, Wim Van Sebroeck
  Cc: asahi, linux-arm-kernel, linux-watchdog, linux-kernel

On 5/6/25 05:01, Florian Klink wrote:
> The hardware only supports timeouts slightly below 3mins, but by using
> max_hw_heartbeat_ms we can let the kernel take care of supporting larger
> timeouts than that requested from userspace.
> 
> Signed-off-by: Florian Klink <flokli@flokli.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-06 12:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 12:01 [PATCH] watchdog: apple: set max_hw_heartbeat_ms instead of max_timeout Florian Klink
2025-05-06 12:31 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®