]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'arm/clock-event' of git://git.pengutronix.de/git/ukl/linux-2.6 into...
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 15 Feb 2010 21:20:33 +0000 (21:20 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 15 Feb 2010 21:20:33 +0000 (21:20 +0000)
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-pxa/time.c
arch/arm/mach-sa1100/time.c
arch/arm/plat-nomadik/timer.c

index 309f3511aa203a3c1c895815bad2bbd9b2d5583a..2500f41d8d2dba517e4cf1d72cf1af225a765d6a 100644 (file)
@@ -58,6 +58,12 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
 {
        u32     sr = at91_sys_read(AT91_ST_SR) & irqmask;
 
+       /*
+        * irqs should be disabled here, but as the irq is shared they are only
+        * guaranteed to be off if the timer irq is registered first.
+        */
+       WARN_ON_ONCE(!irqs_disabled());
+
        /* simulate "oneshot" timer with alarm */
        if (sr & AT91_ST_ALMS) {
                clkevt.event_handler(&clkevt);
@@ -132,24 +138,11 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
 static int
 clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
 {
-       unsigned long   flags;
        u32             alm;
        int             status = 0;
 
        BUG_ON(delta < 2);
 
-       /* Use "raw" primitives so we behave correctly on RT kernels. */
-       raw_local_irq_save(flags);
-
-       /*
-        * According to Thomas Gleixner irqs are already disabled here.  Simply
-        * removing raw_local_irq_save above (and the matching
-        * raw_local_irq_restore) was not accepted.  See
-        * http://thread.gmane.org/gmane.linux.ports.arm.kernel/41174
-        * So for now (2008-11-20) just warn once if irqs were not disabled ...
-        */
-       WARN_ON_ONCE(!raw_irqs_disabled_flags(flags));
-
        /* The alarm IRQ uses absolute time (now+delta), not the relative
         * time (delta) in our calling convention.  Like all clockevents
         * using such "match" hardware, we have a race to defend against.
@@ -169,7 +162,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
        alm += delta;
        at91_sys_write(AT91_ST_RTAR, alm);
 
-       raw_local_irq_restore(flags);
        return status;
 }
 
index 4bd56aee4370b11836325656c4b7b4318b672108..608a63240b64ba9944f511ea9c48879d7878fb08 100644 (file)
@@ -62,16 +62,12 @@ static struct clocksource pit_clk = {
 static void
 pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
 {
-       unsigned long   flags;
-
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
-               /* update clocksource counter, then enable the IRQ */
-               raw_local_irq_save(flags);
+               /* update clocksource counter */
                pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
                at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
                                | AT91_PIT_PITIEN);
-               raw_local_irq_restore(flags);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
                BUG();
@@ -100,6 +96,11 @@ static struct clock_event_device pit_clkevt = {
  */
 static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
 {
+       /*
+        * irqs should be disabled here, but as the irq is shared they are only
+        * guaranteed to be off if the timer irq is registered first.
+        */
+       WARN_ON_ONCE(!irqs_disabled());
 
        /* The PIT interrupt may be disabled, and is shared */
        if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC)
index 750c448db6722288b5dddc87d690d5b5d861b21b..293e40aeaf29d2b7ce2bc3c8b33477b2a1bef4cc 100644 (file)
@@ -76,14 +76,12 @@ pxa_ost0_interrupt(int irq, void *dev_id)
 static int
 pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
 {
-       unsigned long flags, next, oscr;
+       unsigned long next, oscr;
 
-       raw_local_irq_save(flags);
        OIER |= OIER_E0;
        next = OSCR + delta;
        OSMR0 = next;
        oscr = OSCR;
-       raw_local_irq_restore(flags);
 
        return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
 }
@@ -91,23 +89,17 @@ pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
 static void
 pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
 {
-       unsigned long irqflags;
-
        switch (mode) {
        case CLOCK_EVT_MODE_ONESHOT:
-               raw_local_irq_save(irqflags);
                OIER &= ~OIER_E0;
                OSSR = OSSR_M0;
-               raw_local_irq_restore(irqflags);
                break;
 
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_SHUTDOWN:
                /* initializing, released, or preparing for suspend */
-               raw_local_irq_save(irqflags);
                OIER &= ~OIER_E0;
                OSSR = OSSR_M0;
-               raw_local_irq_restore(irqflags);
                break;
 
        case CLOCK_EVT_MODE_RESUME:
index b9cbb56d6e9d9dbd9c7605196488b0872fd8bc4d..74b6e0e570b64e247681d052da44f6dcb645e16b 100644 (file)
@@ -35,14 +35,12 @@ static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
 static int
 sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
 {
-       unsigned long flags, next, oscr;
+       unsigned long next, oscr;
 
-       raw_local_irq_save(flags);
        OIER |= OIER_E0;
        next = OSCR + delta;
        OSMR0 = next;
        oscr = OSCR;
-       raw_local_irq_restore(flags);
 
        return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
 }
@@ -50,16 +48,12 @@ sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
 static void
 sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
 {
-       unsigned long flags;
-
        switch (mode) {
        case CLOCK_EVT_MODE_ONESHOT:
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_SHUTDOWN:
-               raw_local_irq_save(flags);
                OIER &= ~OIER_E0;
                OSSR = OSSR_M0;
-               raw_local_irq_restore(flags);
                break;
 
        case CLOCK_EVT_MODE_RESUME:
index 62f18ad43a282b9019e97b5b2a974d5ef8a9802d..fa7cb3a57cbf68bf974acd8ccfbf25b948158765 100644 (file)
@@ -49,24 +49,17 @@ static struct clocksource nmdk_clksrc = {
 static void nmdk_clkevt_mode(enum clock_event_mode mode,
                             struct clock_event_device *dev)
 {
-       unsigned long flags;
-
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
-               /* enable interrupts -- and count current value? */
-               raw_local_irq_save(flags);
+               /* count current value? */
                writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC);
-               raw_local_irq_restore(flags);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
                BUG(); /* Not supported, yet */
                /* FALLTHROUGH */
        case CLOCK_EVT_MODE_SHUTDOWN:
        case CLOCK_EVT_MODE_UNUSED:
-               /* disable irq */
-               raw_local_irq_save(flags);
                writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC);
-               raw_local_irq_restore(flags);
                break;
        case CLOCK_EVT_MODE_RESUME:
                break;