From: Corey Minyard <minyard@acm.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH] ipmi: fix watchdog timeout panic handling
Date: Fri, 28 Oct 2005 08:23:16 -0500 [thread overview]
Message-ID: <20051028132316.GB10285@i2.minyard.local> (raw)
If a panic came from the IPMI watchdog pretimeout and that was reported
via an NMI, it would also be reported via the standard IPMI flags,
which would get picked up when reporting panic events and cause another
panic. This adds an atomic to avoid calling panic twice.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Index: linux-2.6.14-rc4/drivers/char/ipmi/ipmi_watchdog.c
===================================================================
--- linux-2.6.14-rc4.orig/drivers/char/ipmi/ipmi_watchdog.c
+++ linux-2.6.14-rc4/drivers/char/ipmi/ipmi_watchdog.c
@@ -49,6 +49,7 @@
#include <linux/poll.h>
#include <linux/string.h>
#include <linux/ctype.h>
+#include <asm/atomic.h>
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/apic.h>
#endif
@@ -288,6 +289,8 @@ static int ipmi_start_timer_on_heartbeat
static unsigned char ipmi_version_major;
static unsigned char ipmi_version_minor;
+/* If a pretimeout occurs, this is used to allow only one panic to happen. */
+static atomic_t preop_panic_excl = ATOMIC_INIT(-1);
static int ipmi_heartbeat(void);
static void panic_halt_ipmi_heartbeat(void);
@@ -833,9 +836,10 @@ static void ipmi_wdog_msg_handler(struct
static void ipmi_wdog_pretimeout_handler(void *handler_data)
{
if (preaction_val != WDOG_PRETIMEOUT_NONE) {
- if (preop_val == WDOG_PREOP_PANIC)
- panic("Watchdog pre-timeout");
- else if (preop_val == WDOG_PREOP_GIVE_DATA) {
+ if (preop_val == WDOG_PREOP_PANIC) {
+ if (atomic_inc_and_test(&preop_panic_excl))
+ panic("Watchdog pre-timeout");
+ } else if (preop_val == WDOG_PREOP_GIVE_DATA) {
spin_lock(&ipmi_read_lock);
data_to_read = 1;
wake_up_interruptible(&read_q);
@@ -909,7 +913,8 @@ ipmi_nmi(void *dev_id, struct pt_regs *r
an error and not work unless we re-enable
the timer. So do so. */
pretimeout_since_last_heartbeat = 1;
- panic(PFX "pre-timeout");
+ if (atomic_inc_and_test(&preop_panic_excl))
+ panic(PFX "pre-timeout");
}
return NOTIFY_DONE;
reply other threads:[~2005-10-28 13:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20051028132316.GB10285@i2.minyard.local \
--to=minyard@acm.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®