aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2011-01-28 11:00:32 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-31 07:22:43 -0500
commit397357666de6b5b6adb5fa99f9758ec8cf30ac34 (patch)
treece7e63588928ae0fc3b72e12e5d4298b09916ddf /kernel/watchdog.c
parent4135038a582c20ffdadfcf6564852e0b72a20968 (diff)
watchdog: Fix sysctl consistency
If it was not possible to enable watchdog for any cpu, switch watchdog_enabled back to 0, because it's visible via kernel.watchdog sysctl. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: <stable@kernel.org> LKML-Reference: <1296230433-6261-2-git-send-email-dzickus@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index d9961ea1c3f4..c7e0049344bd 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -429,9 +429,6 @@ static int watchdog_enable(int cpu)
429 wake_up_process(p); 429 wake_up_process(p);
430 } 430 }
431 431
432 /* if any cpu succeeds, watchdog is considered enabled for the system */
433 watchdog_enabled = 1;
434
435 return 0; 432 return 0;
436} 433}
437 434
@@ -459,12 +456,16 @@ static void watchdog_disable(int cpu)
459static void watchdog_enable_all_cpus(void) 456static void watchdog_enable_all_cpus(void)
460{ 457{
461 int cpu; 458 int cpu;
462 int result = 0; 459
460 watchdog_enabled = 0;
463 461
464 for_each_online_cpu(cpu) 462 for_each_online_cpu(cpu)
465 result += watchdog_enable(cpu); 463 if (!watchdog_enable(cpu))
464 /* if any cpu succeeds, watchdog is considered
465 enabled for the system */
466 watchdog_enabled = 1;
466 467
467 if (result) 468 if (!watchdog_enabled)
468 printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n"); 469 printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n");
469 470
470} 471}