From: Don Zickus <dzickus@redhat.com>
To: x86@kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Marcin Slusarz <marcin.slusarz@gmail.com>,
Don Zickus <dzickus@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>,
stable@kernel.org
Subject: [PATCH 2/3] watchdog: Fix sysctl consistency
Date: Fri, 28 Jan 2011 11:00:32 -0500 [thread overview]
Message-ID: <1296230433-6261-2-git-send-email-dzickus@redhat.com> (raw)
In-Reply-To: <1296230433-6261-1-git-send-email-dzickus@redhat.com>
From: Marcin Slusarz <marcin.slusarz@gmail.com>
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>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: stable@kernel.org
Signed-off-by: Don Zickus <dzickus@redhat.com>
---
kernel/watchdog.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 7d4213e..38af39a 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -429,9 +429,6 @@ static int watchdog_enable(int cpu)
wake_up_process(p);
}
- /* if any cpu succeeds, watchdog is considered enabled for the system */
- watchdog_enabled = 1;
-
return 0;
}
@@ -459,12 +456,16 @@ static void watchdog_disable(int cpu)
static void watchdog_enable_all_cpus(void)
{
int cpu;
- int result = 0;
+
+ watchdog_enabled = 0;
for_each_online_cpu(cpu)
- result += watchdog_enable(cpu);
+ if (!watchdog_enable(cpu))
+ /* if any cpu succeeds, watchdog is considered
+ enabled for the system */
+ watchdog_enabled = 1;
- if (result)
+ if (!watchdog_enabled)
printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n");
}
--
1.7.3.4
next prev parent reply other threads:[~2011-01-28 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-28 16:00 [PATCH 1/3] watchdog: Fix broken nowatchdog logic Don Zickus
2011-01-28 16:00 ` Don Zickus [this message]
2011-01-31 12:51 ` [tip:perf/urgent] watchdog: Fix sysctl consistency tip-bot for Marcin Slusarz
2011-01-28 16:00 ` [PATCH 3/3] watchdog: Don't change watchdog state on read of sysctl Don Zickus
2011-01-31 12:52 ` [tip:perf/urgent] " tip-bot for Marcin Slusarz
2011-01-31 12:51 ` [tip:perf/urgent] watchdog: Fix broken nowatchdog logic tip-bot for Marcin Slusarz
-- strict thread matches above, loose matches on Subject: below --
2011-01-18 22:37 [PATCH 2/3] watchdog: fix sysctl consistency Marcin Slusarz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296230433-6261-2-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=mingo@elte.hu \
--cc=stable@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox