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

Michael Jones mike at meshplusplus.com
Tue Sep 29 12:22:04 EDT 2020


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 at meshplusplus.com>
---
 watchdog.c | 1 +
 1 file changed, 1 insertion(+)

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;
-- 
2.26.2




More information about the openwrt-devel mailing list