]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/sn/kernel/xpc_main.c
[IA64] Replace explicit jiffies tests with time_* macros.
[linux-2.6-omap-h63xx.git] / arch / ia64 / sn / kernel / xpc_main.c
index 68355ef6f84170096b52aee5938a390143841e10..9e0b164da9c27a3e040f113354a57b9f4de291fa 100644 (file)
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2004-2006 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2004-2007 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 
@@ -55,9 +55,9 @@
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/completion.h>
+#include <linux/kdebug.h>
 #include <asm/sn/intr.h>
 #include <asm/sn/sn_sal.h>
-#include <asm/kdebug.h>
 #include <asm/uaccess.h>
 #include <asm/sn/xpc.h>
 
@@ -199,7 +199,7 @@ xpc_timeout_partition_disengage_request(unsigned long data)
        struct xpc_partition *part = (struct xpc_partition *) data;
 
 
-       DBUG_ON(jiffies < part->disengage_request_timeout);
+       DBUG_ON(time_before(jiffies, part->disengage_request_timeout));
 
        (void) xpc_partition_disengaged(part);
 
@@ -230,7 +230,7 @@ xpc_hb_beater(unsigned long dummy)
 {
        xpc_vars->heartbeat++;
 
-       if (jiffies >= xpc_hb_check_timeout) {
+       if (time_after_eq(jiffies, xpc_hb_check_timeout)) {
                wake_up_interruptible(&xpc_act_IRQ_wq);
        }
 
@@ -257,7 +257,9 @@ xpc_hb_checker(void *ignore)
 
        set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU));
 
+       /* set our heartbeating to other partitions into motion */
        xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
+       xpc_hb_beater(0);
 
        while (!(volatile int) xpc_exiting) {
 
@@ -268,7 +270,7 @@ xpc_hb_checker(void *ignore)
 
 
                /* checking of remote heartbeats is skewed by IRQ handling */
-               if (jiffies >= xpc_hb_check_timeout) {
+               if (time_after_eq(jiffies, xpc_hb_check_timeout)) {
                        dev_dbg(xpc_part, "checking remote heartbeats\n");
                        xpc_check_remote_hb();
 
@@ -303,7 +305,7 @@ xpc_hb_checker(void *ignore)
                /* wait for IRQ or timeout */
                (void) wait_event_interruptible(xpc_act_IRQ_wq,
                            (last_IRQ_count < atomic_read(&xpc_act_IRQ_rcvd) ||
-                                       jiffies >= xpc_hb_check_timeout ||
+                                       time_after_eq(jiffies, xpc_hb_check_timeout) ||
                                                (volatile int) xpc_exiting));
        }
 
@@ -1332,22 +1334,14 @@ xpc_init(void)
                dev_warn(xpc_part, "can't register reboot notifier\n");
        }
 
-       /* add ourselves to the die_notifier list (i.e., ia64die_chain) */
+       /* add ourselves to the die_notifier list */
        ret = register_die_notifier(&xpc_die_notifier);
        if (ret != 0) {
                dev_warn(xpc_part, "can't register die notifier\n");
        }
 
-
-       /*
-        * Set the beating to other partitions into motion.  This is
-        * the last requirement for other partitions' discovery to
-        * initiate communications with us.
-        */
        init_timer(&xpc_hb_timer);
        xpc_hb_timer.function = xpc_hb_beater;
-       xpc_hb_beater(0);
-
 
        /*
         * The real work-horse behind xpc.  This processes incoming