watchdog: Fix broken nowatchdog logic
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Fri, 28 Jan 2011 16:00:31 +0000 (11:00 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:15:04 +0000 (15:15 -0800)
commit9e93a2ffc5ae0c527331a3600f93894547df62ec
tree76b007b3452535d4cb5b46501783509ceb6ff5c5
parent4cb138966a04517845f625ed142e103a9313eb9b
watchdog: Fix broken nowatchdog logic

commit 4135038a582c20ffdadfcf6564852e0b72a20968 upstream.

Passing nowatchdog to kernel disables 2 things: creation of
watchdog threads AND initialization of percpu watchdog_hrtimer.
As hrtimers are initialized only at boot it's not possible to
enable watchdog later - for me all watchdog threads started to
eat 100% of CPU time, but they could just crash.

Additionally, even if these threads would start properly,
watchdog_disable_all_cpus was guarded by no_watchdog check, so
you couldn't disable watchdog.

To fix this, remove no_watchdog variable and use already
existing watchdog_enabled variable.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
[ removed another no_watchdog instance ]
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1296230433-6261-1-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/watchdog.c