diff options
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 | } |