diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2008-01-30 07:30:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:47 -0500 |
commit | 5f627f8e122a163ce53908d55e088247db31f1d7 (patch) | |
tree | 15e48b30394cbfd014aaf7f99f5a4bfee5b8efbb /arch/mips/kernel | |
parent | b263295dbffd33b0fbff670720fa178c30e3392a (diff) |
mips, x86: optimize the i8259 code a bit
The timer code always calls the clock_event_device set_net_event and
set_mode methods with interrupts disabled, so no need to use
spin_lock_irqsave / spin_unlock_irqrestore for those.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by:Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/i8253.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index c2d497ceffdd..fc4aa07b6d35 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c | |||
@@ -24,9 +24,7 @@ DEFINE_SPINLOCK(i8253_lock); | |||
24 | static void init_pit_timer(enum clock_event_mode mode, | 24 | static void init_pit_timer(enum clock_event_mode mode, |
25 | struct clock_event_device *evt) | 25 | struct clock_event_device *evt) |
26 | { | 26 | { |
27 | unsigned long flags; | 27 | spin_lock(&i8253_lock); |
28 | |||
29 | spin_lock_irqsave(&i8253_lock, flags); | ||
30 | 28 | ||
31 | switch(mode) { | 29 | switch(mode) { |
32 | case CLOCK_EVT_MODE_PERIODIC: | 30 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -55,7 +53,7 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
55 | /* Nothing to do here */ | 53 | /* Nothing to do here */ |
56 | break; | 54 | break; |
57 | } | 55 | } |
58 | spin_unlock_irqrestore(&i8253_lock, flags); | 56 | spin_unlock(&i8253_lock); |
59 | } | 57 | } |
60 | 58 | ||
61 | /* | 59 | /* |
@@ -65,12 +63,10 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
65 | */ | 63 | */ |
66 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) | 64 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) |
67 | { | 65 | { |
68 | unsigned long flags; | 66 | spin_lock(&i8253_lock); |
69 | |||
70 | spin_lock_irqsave(&i8253_lock, flags); | ||
71 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ | 67 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ |
72 | outb(delta >> 8 , PIT_CH0); /* MSB */ | 68 | outb(delta >> 8 , PIT_CH0); /* MSB */ |
73 | spin_unlock_irqrestore(&i8253_lock, flags); | 69 | spin_unlock(&i8253_lock); |
74 | 70 | ||
75 | return 0; | 71 | return 0; |
76 | } | 72 | } |