Merge tag 'linux-kselftest-kunit-5.11-rc1' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / drivers / watchdog / watchdog_core.c
index 861daf4..4238447 100644 (file)
 
 static DEFINE_IDA(watchdog_ida);
 
+static int stop_on_reboot = -1;
+module_param(stop_on_reboot, int, 0444);
+MODULE_PARM_DESC(stop_on_reboot, "Stop watchdogs on reboot (0=keep watching, 1=stop)");
+
 /*
  * Deferred Registration infrastructure.
  *
@@ -254,6 +258,14 @@ static int __watchdog_register_device(struct watchdog_device *wdd)
                }
        }
 
+       /* Module parameter to force watchdog policy on reboot. */
+       if (stop_on_reboot != -1) {
+               if (stop_on_reboot)
+                       set_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
+               else
+                       clear_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
+       }
+
        if (test_bit(WDOG_STOP_ON_REBOOT, &wdd->status)) {
                wdd->reboot_nb.notifier_call = watchdog_reboot_notifier;