]> Pileus Git - ~andy/linux/blobdiff - kernel/time/tick-common.c
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / kernel / time / tick-common.c
index 3f3ae39078306264182734d35df7271b1c74dc48..bf43284d6855ad083319d653d1b0fbc3235dde08 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"
 
 /*
@@ -133,7 +135,7 @@ void tick_setup_periodic(struct clock_event_device *dev, int broadcast)
  */
 static void tick_setup_device(struct tick_device *td,
                              struct clock_event_device *newdev, int cpu,
-                             cpumask_t cpumask)
+                             const cpumask_t *cpumask)
 {
        ktime_t next_event;
        void (*handler)(struct clock_event_device *) = NULL;
@@ -167,8 +169,8 @@ static void tick_setup_device(struct tick_device *td,
         * When the device is not per cpu, pin the interrupt to the
         * current cpu:
         */
-       if (!cpus_equal(newdev->cpumask, cpumask))
-               irq_set_affinity(newdev->irq, cpumask);
+       if (!cpus_equal(newdev->cpumask, *cpumask))
+               irq_set_affinity(newdev->irq, *cpumask);
 
        /*
         * When global broadcasting is active, check if the current
@@ -194,20 +196,20 @@ static int tick_check_new_device(struct clock_event_device *newdev)
        struct tick_device *td;
        int cpu, ret = NOTIFY_OK;
        unsigned long flags;
-       cpumask_t cpumask;
+       cpumask_of_cpu_ptr_declare(cpumask);
 
        spin_lock_irqsave(&tick_device_lock, flags);
 
        cpu = smp_processor_id();
+       cpumask_of_cpu_ptr_next(cpumask, cpu);
        if (!cpu_isset(cpu, newdev->cpumask))
                goto out_bc;
 
        td = &per_cpu(tick_cpu_device, cpu);
        curdev = td->evtdev;
-       cpumask = cpumask_of_cpu(cpu);
 
        /* cpu local device ? */
-       if (!cpus_equal(newdev->cpumask, cpumask)) {
+       if (!cpus_equal(newdev->cpumask, *cpumask)) {
 
                /*
                 * If the cpu affinity of the device interrupt can not
@@ -220,7 +222,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
                 * If we have a cpu local device already, do not replace it
                 * by a non cpu local device
                 */
-               if (curdev && cpus_equal(curdev->cpumask, cpumask))
+               if (curdev && cpus_equal(curdev->cpumask, *cpumask))
                        goto out_bc;
        }
 
@@ -345,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;