diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-11-30 23:12:05 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-05 20:45:39 -0500 |
commit | e74b56800e78a10bc09b56a87831876a1d9d09ae (patch) | |
tree | 0468f7bd4324ffe8d6d7f00ffd2fa3376fcc65aa /arch/sh/kernel/timers/timer-cmt.c | |
parent | bca7c20764c83a44c7b8b0831089922d56a3a9a2 (diff) |
sh: Turn off IRQs around get_timer_offset() calls.
Since all of the sys_timer sources currently do this on their own
within the ->get_offset() path, it's more sensible to just have
the caller take care of it when grabbing xtime_lock. Incidentally,
this is more in line with what others (ie, ARM) are doing already.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/timers/timer-cmt.c')
-rw-r--r-- | arch/sh/kernel/timers/timer-cmt.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/sh/kernel/timers/timer-cmt.c b/arch/sh/kernel/timers/timer-cmt.c index 24b03996da51..95581dccbbfd 100644 --- a/arch/sh/kernel/timers/timer-cmt.c +++ b/arch/sh/kernel/timers/timer-cmt.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/spinlock.h> | ||
15 | #include <linux/seqlock.h> | 14 | #include <linux/seqlock.h> |
16 | #include <asm/timer.h> | 15 | #include <asm/timer.h> |
17 | #include <asm/rtc.h> | 16 | #include <asm/rtc.h> |
@@ -46,13 +45,9 @@ | |||
46 | #error "Unknown CPU SUBTYPE" | 45 | #error "Unknown CPU SUBTYPE" |
47 | #endif | 46 | #endif |
48 | 47 | ||
49 | static DEFINE_SPINLOCK(cmt0_lock); | ||
50 | |||
51 | static unsigned long cmt_timer_get_offset(void) | 48 | static unsigned long cmt_timer_get_offset(void) |
52 | { | 49 | { |
53 | int count; | 50 | int count; |
54 | unsigned long flags; | ||
55 | |||
56 | static unsigned short count_p = 0xffff; /* for the first call after boot */ | 51 | static unsigned short count_p = 0xffff; /* for the first call after boot */ |
57 | static unsigned long jiffies_p = 0; | 52 | static unsigned long jiffies_p = 0; |
58 | 53 | ||
@@ -61,7 +56,6 @@ static unsigned long cmt_timer_get_offset(void) | |||
61 | */ | 56 | */ |
62 | unsigned long jiffies_t; | 57 | unsigned long jiffies_t; |
63 | 58 | ||
64 | spin_lock_irqsave(&cmt0_lock, flags); | ||
65 | /* timer count may underflow right here */ | 59 | /* timer count may underflow right here */ |
66 | count = ctrl_inw(CMT_CMCOR_0); | 60 | count = ctrl_inw(CMT_CMCOR_0); |
67 | count -= ctrl_inw(CMT_CMCNT_0); | 61 | count -= ctrl_inw(CMT_CMCNT_0); |
@@ -88,7 +82,6 @@ static unsigned long cmt_timer_get_offset(void) | |||
88 | jiffies_p = jiffies_t; | 82 | jiffies_p = jiffies_t; |
89 | 83 | ||
90 | count_p = count; | 84 | count_p = count; |
91 | spin_unlock_irqrestore(&cmt0_lock, flags); | ||
92 | 85 | ||
93 | count = ((LATCH-1) - count) * TICK_SIZE; | 86 | count = ((LATCH-1) - count) * TICK_SIZE; |
94 | count = (count + LATCH/2) / LATCH; | 87 | count = (count + LATCH/2) / LATCH; |
@@ -122,7 +115,7 @@ static irqreturn_t cmt_timer_interrupt(int irq, void *dev_id) | |||
122 | static struct irqaction cmt_irq = { | 115 | static struct irqaction cmt_irq = { |
123 | .name = "timer", | 116 | .name = "timer", |
124 | .handler = cmt_timer_interrupt, | 117 | .handler = cmt_timer_interrupt, |
125 | .flags = IRQF_DISABLED, | 118 | .flags = IRQF_DISABLED | IRQF_TIMER, |
126 | .mask = CPU_MASK_NONE, | 119 | .mask = CPU_MASK_NONE, |
127 | }; | 120 | }; |
128 | 121 | ||