diff options
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch')
-rw-r--r-- | meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch new file mode 100644 index 0000000000..78a297400f --- /dev/null +++ b/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | From 42cb68d81a218b0fd7c053356d379a93270b40ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Yong Wang <yong.y.wang@intel.com> | ||
3 | Date: Fri, 30 Oct 2009 10:33:20 +0800 | ||
4 | Subject: [PATCH] x86: Do not unregister PIT clocksource on PIT oneshot setup/shutdown | ||
5 | |||
6 | Backported from upstream commit 8cab02dc3c58a12235c6d463ce684dded9696848 | ||
7 | and this fixes bug #7377 "system can not resume from S3". Further information | ||
8 | can be found at http://bugzilla.kernel.org/show_bug.cgi?id=14222. | ||
9 | |||
10 | Signed-off-by: Yong Wang <yong.y.wang@intel.com> | ||
11 | --- | ||
12 | arch/x86/kernel/i8253.c | 36 ++---------------------------------- | ||
13 | 1 files changed, 2 insertions(+), 34 deletions(-) | ||
14 | |||
15 | diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c | ||
16 | index da890f0..23c1679 100644 | ||
17 | --- a/arch/x86/kernel/i8253.c | ||
18 | +++ b/arch/x86/kernel/i8253.c | ||
19 | @@ -19,14 +19,6 @@ | ||
20 | DEFINE_SPINLOCK(i8253_lock); | ||
21 | EXPORT_SYMBOL(i8253_lock); | ||
22 | |||
23 | -#ifdef CONFIG_X86_32 | ||
24 | -static void pit_disable_clocksource(void); | ||
25 | -static void pit_enable_clocksource(void); | ||
26 | -#else | ||
27 | -static inline void pit_disable_clocksource(void) { } | ||
28 | -static inline void pit_enable_clocksource(void) { } | ||
29 | -#endif | ||
30 | - | ||
31 | /* | ||
32 | * HPET replaces the PIT, when enabled. So we need to know, which of | ||
33 | * the two timers is used | ||
34 | @@ -59,17 +51,15 @@ static void init_pit_timer(enum clock_event_mode mode, | ||
35 | outb_pit(0, PIT_CH0); | ||
36 | outb_pit(0, PIT_CH0); | ||
37 | } | ||
38 | - pit_disable_clocksource(); | ||
39 | break; | ||
40 | |||
41 | case CLOCK_EVT_MODE_ONESHOT: | ||
42 | /* One shot setup */ | ||
43 | - pit_disable_clocksource(); | ||
44 | outb_pit(0x38, PIT_MODE); | ||
45 | break; | ||
46 | |||
47 | case CLOCK_EVT_MODE_RESUME: | ||
48 | - pit_enable_clocksource(); | ||
49 | + /* Nothing to do here */ | ||
50 | break; | ||
51 | } | ||
52 | spin_unlock(&i8253_lock); | ||
53 | @@ -202,27 +192,8 @@ static struct clocksource pit_cs = { | ||
54 | .shift = 20, | ||
55 | }; | ||
56 | |||
57 | -int pit_cs_registered; | ||
58 | -static void pit_disable_clocksource(void) | ||
59 | -{ | ||
60 | - if (pit_cs_registered) { | ||
61 | - clocksource_unregister(&pit_cs); | ||
62 | - pit_cs_registered = 0; | ||
63 | - } | ||
64 | -} | ||
65 | - | ||
66 | -static void pit_enable_clocksource(void) | ||
67 | -{ | ||
68 | - if (!pit_cs_registered && !clocksource_register(&pit_cs)) { | ||
69 | - pit_cs_registered = 1; | ||
70 | - } | ||
71 | -} | ||
72 | - | ||
73 | - | ||
74 | - | ||
75 | static int __init init_pit_clocksource(void) | ||
76 | { | ||
77 | - int ret; | ||
78 | /* | ||
79 | * Several reasons not to register PIT as a clocksource: | ||
80 | * | ||
81 | @@ -236,10 +207,7 @@ static int __init init_pit_clocksource(void) | ||
82 | |||
83 | pit_cs.mult = clocksource_hz2mult(CLOCK_TICK_RATE, pit_cs.shift); | ||
84 | |||
85 | - ret = clocksource_register(&pit_cs); | ||
86 | - if (!ret) | ||
87 | - pit_cs_registered = 1; | ||
88 | - return ret; | ||
89 | + return clocksource_register(&pit_cs); | ||
90 | } | ||
91 | arch_initcall(init_pit_clocksource); | ||
92 | |||
93 | -- | ||
94 | 1.5.5.1 | ||
95 | |||