All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: avoid kernel crash when disabling watchdog
@ 2010-09-14 13:34 Stephane Eranian
  2010-09-15 10:01 ` [tip:perf/core] watchdog: Avoid " tip-bot for Stephane Eranian
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2010-09-14 13:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterz, mingo, paulus, davem, fweisbec, perfmon2-devel, eranian,
	eranian, robert.richter, dzickus

In case you boot with the watchdog disabled, i.e., nowatchdog, then,
if you try to disable it via /proc/sys/kernel/watchdog, you get
a kernel crash. The reason is that you are trying to cancel a hrtimer
which has never been initialized.

This patch fixes this by skipping execution of
watchdog_disable_all_cpus() when the watchdog is marked
disabled from boot.

Signed-off-by: Stephane Eranian <eranian@google.com>
--
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 69a3d44..f335067 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -473,6 +473,9 @@ static void watchdog_disable_all_cpus(void)
 {
 	int cpu;
 
+	if (no_watchdog)
+		return;
+
 	for_each_online_cpu(cpu)
 		watchdog_disable(cpu);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] watchdog: Avoid kernel crash when disabling watchdog
  2010-09-14 13:34 [PATCH] watchdog: avoid kernel crash when disabling watchdog Stephane Eranian
@ 2010-09-15 10:01 ` tip-bot for Stephane Eranian
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Stephane Eranian @ 2010-09-15 10:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, eranian, hpa, mingo, a.p.zijlstra, tglx, mingo

Commit-ID:  d9ca07a05ce1c42ac9717e54eaea4546a3a80978
Gitweb:     http://git.kernel.org/tip/d9ca07a05ce1c42ac9717e54eaea4546a3a80978
Author:     Stephane Eranian <eranian@google.com>
AuthorDate: Tue, 14 Sep 2010 15:34:01 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 15 Sep 2010 10:43:58 +0200

watchdog: Avoid kernel crash when disabling watchdog

In case you boot with the watchdog disabled, i.e., nowatchdog, then,
if you try to disable it via /proc/sys/kernel/watchdog, you get
a kernel crash. The reason is that you are trying to cancel a hrtimer
which has never been initialized.

This patch fixes this by skipping execution of
watchdog_disable_all_cpus() when the watchdog is marked
disabled from boot.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4c8f7a23.cae9d80a.2c11.0bb4@mx.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/watchdog.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index fa71aeb..89eadbb 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -473,6 +473,9 @@ static void watchdog_disable_all_cpus(void)
 {
 	int cpu;
 
+	if (no_watchdog)
+		return;
+
 	for_each_online_cpu(cpu)
 		watchdog_disable(cpu);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-15 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-14 13:34 [PATCH] watchdog: avoid kernel crash when disabling watchdog Stephane Eranian
2010-09-15 10:01 ` [tip:perf/core] watchdog: Avoid " tip-bot for Stephane Eranian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.