sg3-utils: add newer buildable version
[openembedded.git] / recipes / linux / logicpd-pxa270-2.6.19.2 / pxa_timerfix-r0.patch
1 PXA Timers: Stop interrupts becomming enabled when they shouldn't be
2
3 Calling save_time_delta() from within pxa_pm_enter() isn't allowed as it 
4 will reenable interrupts in a function where they should be disabled 
5 throughout. These calls can be made safely from the time.c suspend/resume 
6 functions instead.
7
8 Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
9
10
11 Index: linux-2.6.12/arch/arm/mach-pxa/pm.c
12 ===================================================================
13 --- linux-2.6.12.orig/arch/arm/mach-pxa/pm.c    2005-08-21 20:05:16.000000000 +0100
14 +++ linux-2.6.12/arch/arm/mach-pxa/pm.c 2005-08-21 20:06:02.000000000 +0100
15 @@ -78,7 +78,6 @@
16  {
17         unsigned long sleep_save[SLEEP_SAVE_SIZE];
18         unsigned long checksum = 0;
19 -       struct timespec delta, rtc;
20         int i;
21         extern void pxa_cpu_pm_enter(suspend_state_t state);
22  
23 @@ -87,11 +86,6 @@
24         iwmmxt_task_disable(NULL);
25  #endif
26  
27 -       /* preserve current time */
28 -       rtc.tv_sec = RCNR;
29 -       rtc.tv_nsec = 0;
30 -       save_time_delta(&delta, &rtc);
31 -
32         SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2);
33         SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2);
34         SAVE(GRER0); SAVE(GRER1); SAVE(GRER2);
35 @@ -182,10 +176,6 @@
36  
37         RESTORE(PSTR);
38  
39 -       /* restore current time */
40 -       rtc.tv_sec = RCNR;
41 -       restore_time_delta(&delta, &rtc);
42 -
43  #ifdef DEBUG
44         printk(KERN_DEBUG "*** made it back from resume\n");
45  #endif
46 Index: linux-2.6.12/arch/arm/mach-pxa/time.c
47 ===================================================================
48 --- linux-2.6.12.orig/arch/arm/mach-pxa/time.c  2005-08-21 20:04:39.000000000 +0100
49 +++ linux-2.6.12/arch/arm/mach-pxa/time.c       2005-08-21 20:05:24.000000000 +0100
50 @@ -128,6 +128,7 @@
51  
52  #ifdef CONFIG_PM
53  static unsigned long osmr[4], oier;
54 +static struct timespec delta, rtc;
55  
56  static void pxa_timer_suspend(void)
57  {
58 @@ -136,10 +137,19 @@
59         osmr[2] = OSMR2;
60         osmr[3] = OSMR3;
61         oier = OIER;
62 +
63 +       /* preserve current time */
64 +       rtc.tv_sec = RCNR;
65 +       rtc.tv_nsec = 0;
66 +       save_time_delta(&delta, &rtc);
67  }
68  
69  static void pxa_timer_resume(void)
70  {
71 +       /* restore current time */
72 +       rtc.tv_sec = RCNR;
73 +       restore_time_delta(&delta, &rtc);
74 +
75         OSMR0 = osmr[0];
76         OSMR1 = osmr[1];
77         OSMR2 = osmr[2];