changed Makefile and profiles, added patches for kernel 2.6.24
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1117-audio-tickless-timeout.patch.patch
1 From 5d6f04132cb5bd8fa8f1c9c9c3dc337aeae18f4c Mon Sep 17 00:00:00 2001
2 From: Werner Almesberger <werner@openmoko.org>
3 Date: Sun, 13 Apr 2008 07:25:55 +0100
4 Subject: [PATCH] audio-tickless-timeout.patch
5
6 When we resume, we can end up in
7 sound/soc/s3c24xx/s3c24xx-i2s.c:s3c24xx_snd_lrsync
8 with the timer tick still disabled, and the LR signal never happening.
9 Thus, we loop forever.
10
11 The patch below changes the timeout mechanism to use udelay, which
12 doesn't need timer ticks.
13
14 Note that this code is in a module, so to get the fix, you have to
15 build the modules, and update them.
16
17 The kernel now resumes but does the ugly GSM modem ticking. I'll have
18 to find a good place to turn that one off ...
19
20 - Werner
21
22 ---------------------------------- cut here -----------------------------------
23
24 - sound/soc/s3c24xx/s3c24xx-i2s.c (s3c24xx_snd_lrsync): in resume, we may
25   call s3c24xx_snd_lrsync with timer ticks disabled, thus jiffies never
26   change. Use udelay to avoid this problem.
27 ---
28  sound/soc/s3c24xx/s3c24xx-i2s.c |    5 +++--
29  1 files changed, 3 insertions(+), 2 deletions(-)
30
31 diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
32 index 4d74cc0..43fd25a 100644
33 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c
34 +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
35 @@ -180,7 +180,7 @@ static void s3c24xx_snd_rxctrl(int on)
36  static int s3c24xx_snd_lrsync(void)
37  {
38         u32 iiscon;
39 -       unsigned long timeout = jiffies + msecs_to_jiffies(5);
40 +       int timeout = 50; /* 5ms */
41  
42         DBG("Entered %s\n", __FUNCTION__);
43  
44 @@ -189,8 +189,9 @@ static int s3c24xx_snd_lrsync(void)
45                 if (iiscon & S3C2410_IISCON_LRINDEX)
46                         break;
47  
48 -               if (timeout < jiffies)
49 +               if (!--timeout)
50                         return -ETIMEDOUT;
51 +               udelay(100);
52         }
53  
54         return 0;
55 -- 
56 1.5.6.5
57