kontron_wdt: Enforce timeout value if already set
authorErwan Velu <erwan.velu@zodiacaerospace.com>
Mon, 10 Sep 2012 15:38:16 +0000 (17:38 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Mon, 10 Sep 2012 18:20:43 +0000 (20:20 +0200)
If the watchdog was already engaged, let's rewrite the timeout to insure
the proper value is set.

com32/modules/kontron_wdt.c

index 6d21d7c..4e1d253 100644 (file)
@@ -378,6 +378,10 @@ int main(int argc, const char *argv[]) {
         status = kempld_read8(&pld, KEMPLD_WDT_CFG);
        /* kick the watchdog if it is already enabled, otherwise start it */
         if (status & KEMPLD_WDT_CFG_ENABLE) {
+               /* Maybye the BIOS did setup a first timer
+                * in this case, let's enforce the timeout
+                * to be sure we do have the proper value */
+               kempld_wdt_settimeout(&wdt);
                 kempld_wdt_keepalive(&wdt);
         } else {
                ret = kempld_wdt_settimeout(&wdt);