Re: [patch] Real-Time Preemption, -RT-2.6.9-rc4-mm1-U9

From: Thomas Gleixner
Date: Thu Oct 21 2004 - 09:57:06 EST


On Thu, 2004-10-21 at 16:22, Thomas Gleixner wrote:
> On Thu, 2004-10-21 at 15:27, Ingo Molnar wrote:
> > i have released the -U9 Real-Time Preemption patch, which can be
> > downloaded from:
> >
> > http://redhat.com/~mingo/realtime-preempt/
> >
>
> impi watchdog conversion to completion api.

Sorry, I copied the wrong file to the correct place.

tglx

diff --exclude='*~' -urN
2.6.9-rc4-mm1-RT-U9/drivers/char/ipmi/ipmi_watchdog.c
2.6.9-rc4-mm1-U9-E0/drivers/char/ipmi/ipmi_watchdog.c
--- 2.6.9-rc4-mm1-RT-U9/drivers/char/ipmi/ipmi_watchdog.c 2004-10-21
15:47:23.000000000 +0200
+++ 2.6.9-rc4-mm1-U9-E0/drivers/char/ipmi/ipmi_watchdog.c 2004-10-21
16:25:14.000000000 +0200
@@ -47,6 +47,7 @@
#include <linux/reboot.h>
#include <linux/wait.h>
#include <linux/poll.h>
+#include <linux/completion.h>
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/apic.h>
#endif
@@ -386,16 +387,16 @@
when both messages are free. */
static atomic_t heartbeat_tofree = ATOMIC_INIT(0);
static DECLARE_MUTEX(heartbeat_lock);
-static DECLARE_MUTEX(heartbeat_wait_lock);
+static DECLARE_COMPLETION(heartbeat_received);
static void heartbeat_free_smi(struct ipmi_smi_msg *msg)
{
if (atomic_dec_and_test(&heartbeat_tofree))
- up(&heartbeat_wait_lock);
+ complete(&heartbeat_received);
}
static void heartbeat_free_recv(struct ipmi_recv_msg *msg)
{
if (atomic_dec_and_test(&heartbeat_tofree))
- up(&heartbeat_wait_lock);
+ complete(&heartbeat_received);
}
static struct ipmi_smi_msg heartbeat_smi_msg =
{
@@ -473,7 +474,7 @@
}

/* Wait for the heartbeat to be sent. */
- down(&heartbeat_wait_lock);
+ wait_for_completion(&heartbeat_received);

if (heartbeat_recv_msg.msg.data[0] != 0) {
/* Got an error in the heartbeat response. It was already
@@ -944,7 +945,6 @@
{
int rv;

- init_MUTEX_LOCKED(&heartbeat_wait_lock);
printk(KERN_INFO PFX "driver version "
IPMI_WATCHDOG_VERSION "\n");



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/