summaryrefslogtreecommitdiffstats
path: root/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.33-pit-fix.patch
blob: 78a297400f86068dc8668430c72282a27b64e709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From 42cb68d81a218b0fd7c053356d379a93270b40ea Mon Sep 17 00:00:00 2001
From: Yong Wang <yong.y.wang@intel.com>
Date: Fri, 30 Oct 2009 10:33:20 +0800
Subject: [PATCH] x86: Do not unregister PIT clocksource on PIT oneshot setup/shutdown

Backported from upstream commit 8cab02dc3c58a12235c6d463ce684dded9696848
and this fixes bug #7377 "system can not resume from S3". Further information
can be found at http://bugzilla.kernel.org/show_bug.cgi?id=14222.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
---
 arch/x86/kernel/i8253.c |   36 ++----------------------------------
 1 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index da890f0..23c1679 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -19,14 +19,6 @@
 DEFINE_SPINLOCK(i8253_lock);
 EXPORT_SYMBOL(i8253_lock);
 
-#ifdef CONFIG_X86_32
-static void pit_disable_clocksource(void);
-static void pit_enable_clocksource(void);
-#else
-static inline void pit_disable_clocksource(void) { }
-static inline void pit_enable_clocksource(void) { }
-#endif
-
 /*
  * HPET replaces the PIT, when enabled. So we need to know, which of
  * the two timers is used
@@ -59,17 +51,15 @@ static void init_pit_timer(enum clock_event_mode mode,
 			outb_pit(0, PIT_CH0);
 			outb_pit(0, PIT_CH0);
 		}
-		pit_disable_clocksource();
 		break;
 
 	case CLOCK_EVT_MODE_ONESHOT:
 		/* One shot setup */
-		pit_disable_clocksource();
 		outb_pit(0x38, PIT_MODE);
 		break;
 
 	case CLOCK_EVT_MODE_RESUME:
-		pit_enable_clocksource();
+		/* Nothing to do here */
 		break;
 	}
 	spin_unlock(&i8253_lock);
@@ -202,27 +192,8 @@ static struct clocksource pit_cs = {
 	.shift		= 20,
 };
 
-int pit_cs_registered;
-static void pit_disable_clocksource(void)
-{
-	if (pit_cs_registered) {
-		clocksource_unregister(&pit_cs);
-		pit_cs_registered = 0;
-	}
-}
-
-static void pit_enable_clocksource(void)
-{
-	if (!pit_cs_registered && !clocksource_register(&pit_cs)) {
-		pit_cs_registered = 1;
-	}
-}
-
-
-
 static int __init init_pit_clocksource(void)
 {
-	int ret;
 	 /*
 	  * Several reasons not to register PIT as a clocksource:
 	  *
@@ -236,10 +207,7 @@ static int __init init_pit_clocksource(void)
 
 	pit_cs.mult = clocksource_hz2mult(CLOCK_TICK_RATE, pit_cs.shift);
 
-	ret = clocksource_register(&pit_cs);
-	if (!ret)
-		pit_cs_registered = 1;
-	return ret;
+	return clocksource_register(&pit_cs);
 }
 arch_initcall(init_pit_clocksource);
 
-- 
1.5.5.1