]> err.no Git - linux-2.6/blobdiff - kernel/time/tick-common.c
Merge branch 'sa1100'
[linux-2.6] / kernel / time / tick-common.c
index a96ec9ab3454e57acf53f4fa70b48ed84e634b8d..4f3886562b8cb919c48110cc8c198c65ea93e54a 100644 (file)
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/hrtimer.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>
 #include <linux/tick.h>
 
+#include <asm/irq_regs.h>
+
 #include "tick-internal.h"
 
 /*
@@ -200,7 +202,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
 
        cpu = smp_processor_id();
        if (!cpu_isset(cpu, newdev->cpumask))
-               goto out;
+               goto out_bc;
 
        td = &per_cpu(tick_cpu_device, cpu);
        curdev = td->evtdev;
@@ -265,7 +267,7 @@ out_bc:
         */
        if (tick_check_broadcast_device(newdev))
                ret = NOTIFY_STOP;
-out:
+
        spin_unlock_irqrestore(&tick_device_lock, flags);
 
        return ret;
@@ -318,12 +320,17 @@ static void tick_resume(void)
 {
        struct tick_device *td = &__get_cpu_var(tick_cpu_device);
        unsigned long flags;
+       int broadcast = tick_resume_broadcast();
 
        spin_lock_irqsave(&tick_device_lock, flags);
-       if (td->mode == TICKDEV_MODE_PERIODIC)
-               tick_setup_periodic(td->evtdev, 0);
-       else
-               tick_resume_oneshot();
+       clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_RESUME);
+
+       if (!broadcast) {
+               if (td->mode == TICKDEV_MODE_PERIODIC)
+                       tick_setup_periodic(td->evtdev, 0);
+               else
+                       tick_resume_oneshot();
+       }
        spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
@@ -340,6 +347,7 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
 
        case CLOCK_EVT_NOTIFY_BROADCAST_ON:
        case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
+       case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
                tick_broadcast_on_off(reason, dev);
                break;
 
@@ -360,8 +368,7 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
                break;
 
        case CLOCK_EVT_NOTIFY_RESUME:
-               if (!tick_resume_broadcast())
-                       tick_resume();
+               tick_resume();
                break;
 
        default: