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/x86/kernel/i8253.c | |
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/x86/kernel/i8253.c')
-rw-r--r-- | arch/x86/kernel/i8253.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c index 377c3f8411f8..c76fef1ce355 100644 --- a/arch/x86/kernel/i8253.c +++ b/arch/x86/kernel/i8253.c | |||
@@ -38,9 +38,7 @@ struct clock_event_device *global_clock_event; | |||
38 | static void init_pit_timer(enum clock_event_mode mode, | 38 | static void init_pit_timer(enum clock_event_mode mode, |
39 | struct clock_event_device *evt) | 39 | struct clock_event_device *evt) |
40 | { | 40 | { |
41 | unsigned long flags; | 41 | spin_lock(&i8253_lock); |
42 | |||
43 | spin_lock_irqsave(&i8253_lock, flags); | ||
44 | 42 | ||
45 | switch(mode) { | 43 | switch(mode) { |
46 | case CLOCK_EVT_MODE_PERIODIC: | 44 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -71,7 +69,7 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
71 | /* Nothing to do here */ | 69 | /* Nothing to do here */ |
72 | break; | 70 | break; |
73 | } | 71 | } |
74 | spin_unlock_irqrestore(&i8253_lock, flags); | 72 | spin_unlock(&i8253_lock); |
75 | } | 73 | } |
76 | 74 | ||
77 | /* | 75 | /* |
@@ -81,12 +79,10 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
81 | */ | 79 | */ |
82 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) | 80 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) |
83 | { | 81 | { |
84 | unsigned long flags; | 82 | spin_lock(&i8253_lock); |
85 | |||
86 | spin_lock_irqsave(&i8253_lock, flags); | ||
87 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ | 83 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ |
88 | outb(delta >> 8 , PIT_CH0); /* MSB */ | 84 | outb(delta >> 8 , PIT_CH0); /* MSB */ |
89 | spin_unlock_irqrestore(&i8253_lock, flags); | 85 | spin_unlock(&i8253_lock); |
90 | 86 | ||
91 | return 0; | 87 | return 0; |
92 | } | 88 | } |