diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-07-21 07:37:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-21 20:49:15 -0400 |
commit | 18de5bc4c1f1f1fa5e14f354a7603bd6e9d4e3b6 (patch) | |
tree | cb0ff399fb3f368adecf213318e32a499ada6ff9 /arch/i386/kernel/i8253.c | |
parent | 93da56efcf8c6a111f0349f6b7651172d4745ca0 (diff) |
clockevents: fix resume logic
We need to make sure, that the clockevent devices are resumed, before
the tick is resumed. The current resume logic does not guarantee this.
Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock
event devices before resuming the tick / oneshot functionality.
Fixup the existing users.
Thanks to Nigel Cunningham for tracking down a long standing thinko,
which affected the jinxed VAIO.
[akpm@linux-foundation.org: xen build fix]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386/kernel/i8253.c')
-rw-r--r-- | arch/i386/kernel/i8253.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c index f8a3c4054c70..931eabe1e560 100644 --- a/arch/i386/kernel/i8253.c +++ b/arch/i386/kernel/i8253.c | |||
@@ -3,11 +3,11 @@ | |||
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #include <linux/clockchips.h> | 5 | #include <linux/clockchips.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/init.h> |
7 | #include <linux/interrupt.h> | ||
7 | #include <linux/jiffies.h> | 8 | #include <linux/jiffies.h> |
8 | #include <linux/sysdev.h> | ||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/init.h> | 10 | #include <linux/spinlock.h> |
11 | 11 | ||
12 | #include <asm/smp.h> | 12 | #include <asm/smp.h> |
13 | #include <asm/delay.h> | 13 | #include <asm/delay.h> |
@@ -41,26 +41,24 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
41 | case CLOCK_EVT_MODE_PERIODIC: | 41 | case CLOCK_EVT_MODE_PERIODIC: |
42 | /* binary, mode 2, LSB/MSB, ch 0 */ | 42 | /* binary, mode 2, LSB/MSB, ch 0 */ |
43 | outb_p(0x34, PIT_MODE); | 43 | outb_p(0x34, PIT_MODE); |
44 | udelay(10); | ||
45 | outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ | 44 | outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ |
46 | udelay(10); | ||
47 | outb(LATCH >> 8 , PIT_CH0); /* MSB */ | 45 | outb(LATCH >> 8 , PIT_CH0); /* MSB */ |
48 | break; | 46 | break; |
49 | 47 | ||
50 | /* | ||
51 | * Avoid unnecessary state transitions, as it confuses | ||
52 | * Geode / Cyrix based boxen. | ||
53 | */ | ||
54 | case CLOCK_EVT_MODE_SHUTDOWN: | 48 | case CLOCK_EVT_MODE_SHUTDOWN: |
55 | if (evt->mode == CLOCK_EVT_MODE_UNUSED) | ||
56 | break; | ||
57 | case CLOCK_EVT_MODE_UNUSED: | 49 | case CLOCK_EVT_MODE_UNUSED: |
58 | if (evt->mode == CLOCK_EVT_MODE_SHUTDOWN) | 50 | outb_p(0x30, PIT_MODE); |
59 | break; | 51 | outb_p(0, PIT_CH0); /* LSB */ |
52 | outb_p(0, PIT_CH0); /* MSB */ | ||
53 | break; | ||
54 | |||
60 | case CLOCK_EVT_MODE_ONESHOT: | 55 | case CLOCK_EVT_MODE_ONESHOT: |
61 | /* One shot setup */ | 56 | /* One shot setup */ |
62 | outb_p(0x38, PIT_MODE); | 57 | outb_p(0x38, PIT_MODE); |
63 | udelay(10); | 58 | break; |
59 | |||
60 | case CLOCK_EVT_MODE_RESUME: | ||
61 | /* Nothing to do here */ | ||
64 | break; | 62 | break; |
65 | } | 63 | } |
66 | spin_unlock_irqrestore(&i8253_lock, flags); | 64 | spin_unlock_irqrestore(&i8253_lock, flags); |