diff mbox series

[3/5] initd: Ensure that watchdog frequency changes apply right away

Message ID 33a0253a-1bd6-d223-2cd6-1e92ed8a4ccc@meshplusplus.com
State Changes Requested
Headers show
Series [1/5] initd: Add ubus argument to trigger watchdog tickle. | expand

Commit Message

Michael Jones Sept. 29, 2020, 4:22 p.m. UTC
If the watchdog frequency is changed from high to low,
the watchdog won't be tickled again until the previous
period has expired, which may result in a watchdog timeout.
This change ensures that the new frequency is applied immediately.

Signed-off-by: Michael Jones <mike@meshplusplus.com>
---
 watchdog.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/watchdog.c b/watchdog.c
index 20b6e20..20830c3 100644
--- a/watchdog.c
+++ b/watchdog.c
@@ -140,6 +140,7 @@  int watchdog_frequency(int frequency)
     if (frequency) {
         DEBUG(4, "Set watchdog frequency: %ds\n", frequency);
         wdt_frequency = frequency;
+        watchdog_timeout_cb(&wdt_timeout);
     }
 
     return wdt_frequency;