]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kernel/watchdog.c: add comments to explain watchdog_disabled variable
authoranish kumar <anish198519851985@gmail.com>
Wed, 20 Mar 2013 04:07:31 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:33:56 +0000 (16:33 +1100)
This watchdog_disabled flag is a bit cryptic.  However it's usefulness is
multifold.  Uses are:

1. Check if smpboot_register_percpu_thread function passed.
2. Makes sure that user enables and disables the watchdog in sequence
   i.e. enable watchdog->disable watchdog->enable watchdog
   Unlike enable watchdog->enable watchdog which is wrong.

[dzickus@redhat.com: small text cleanups]
Signed-off-by: anish kumar <anish198519851985@gmail.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/watchdog.c

index 7672bef6c88b9cb342a65442a649dbbfe16ddcaf..ea741c32d5963d2838a2f8e238af4ac74a20a4f4 100644 (file)
@@ -521,6 +521,11 @@ int proc_dowatchdog(struct ctl_table *table, int write,
                return ret;
 
        set_sample_period();
+       /*
+        * Watchdog threads shouldn't be enabled if they are
+        * disabled. The 'watchdog_disabled' variable check in
+        * watchdog_*_all_cpus() function takes care of this.
+        */
        if (watchdog_enabled && watchdog_thresh)
                watchdog_enable_all_cpus();
        else